Home | History | Annotate | Download | only in functional
      1 /*
      2  * Copyright (C) 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #include <android-base/logging.h>
     18 
     19 #include <VtsHalHidlTargetTestBase.h>
     20 
     21 #include <android/hardware/radio/1.0/types.h>
     22 
     23 using ::android::hardware::radio::V1_0::RadioError;
     24 using ::android::hardware::radio::V1_0::SapResultCode;
     25 using namespace std;
     26 
     27 enum CheckFlag {
     28     CHECK_DEFAULT = 0,
     29     CHECK_GENERAL_ERROR = 1,
     30     CHECK_OEM_ERROR = 2,
     31     CHECK_OEM_AND_GENERAL_ERROR = 3,
     32     CHECK_SAP_ERROR = 4,
     33 };
     34 
     35 /*
     36  * Generate random serial number for radio test
     37  */
     38 int GetRandomSerialNumber();
     39 
     40 /*
     41  * Check multiple radio error codes which are possibly returned because of the different
     42  * vendor/devices implementations. It allows optional checks for general errors or/and oem errors.
     43  */
     44 ::testing::AssertionResult CheckAnyOfErrors(RadioError err, std::vector<RadioError> generalError,
     45                                             CheckFlag flag = CHECK_DEFAULT);
     46 /*
     47  * Check multiple sap error codes which are possibly returned because of the different
     48  * vendor/devices implementations.
     49  */
     50 ::testing::AssertionResult CheckAnyOfErrors(SapResultCode err, std::vector<SapResultCode> errors);
     51