OSDN Git Service

Add a new vts directory under 1.1 for radio 1.1 APIs vts tests.
[android-x86/hardware-interfaces.git] / radio / 1.1 / vts / functional / radio_hidl_hal_api.cpp
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 <radio_hidl_hal_utils_v1_1.h>
18
19 /*
20  * Test IRadio.setSimCardPower() for the response returned.
21  */
22 TEST_F(RadioHidlTest_v1_1, setSimCardPower_1_1) {
23     int serial = GetRandomSerialNumber();
24
25     radio_v1_1->setSimCardPower_1_1(serial, CardPowerState::POWER_DOWN);
26     EXPECT_EQ(std::cv_status::no_timeout, wait());
27     EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_1->rspInfo.type);
28     EXPECT_EQ(serial, radioRsp_v1_1->rspInfo.serial);
29
30     if (cardStatus.cardState == CardState::ABSENT) {
31         ASSERT_TRUE(radioRsp_v1_1->rspInfo.error == RadioError::NONE ||
32                     radioRsp_v1_1->rspInfo.error == RadioError::REQUEST_NOT_SUPPORTED ||
33                     radioRsp_v1_1->rspInfo.error == RadioError::INVALID_ARGUMENTS ||
34                     radioRsp_v1_1->rspInfo.error == RadioError::RADIO_NOT_AVAILABLE);
35     }
36 }