Convert VtsHalRadioV1_*TargetTest to be parameterized test
Bug: 142397658
Bug: 142972256
Test: atest VtsHalRadioV1_0TargetTest \
VtsHalSapV1_0TargetTest \
VtsHalRadioV1_1TargetTest \
VtsHalRadioV1_2TargetTest \
VtsHalRadioV1_3TargetTest \
VtsHalRadioV1_4TargetTest
Change-Id: I1890f7a6b1401260e87c94c2bc4e1dfa7060a0cb
diff --git a/radio/1.0/vts/functional/Android.bp b/radio/1.0/vts/functional/Android.bp
index 9dec2f2..2351d90 100644
--- a/radio/1.0/vts/functional/Android.bp
+++ b/radio/1.0/vts/functional/Android.bp
@@ -33,7 +33,8 @@
static_libs: [
"android.hardware.radio@1.0",
],
- test_suites: ["general-tests"],
+ test_config: "vts_hal_radio_target_test.xml",
+ test_suites: ["general-tests", "vts-core"],
}
cc_test {
@@ -47,7 +48,8 @@
static_libs: [
"android.hardware.radio@1.0",
],
- test_suites: ["general-tests"],
+ test_config: "vts_hal_sap_target_test.xml",
+ test_suites: ["general-tests", "vts-core"],
}
cc_library_static {
diff --git a/radio/1.0/vts/functional/VtsHalRadioV1_0TargetTest.cpp b/radio/1.0/vts/functional/VtsHalRadioV1_0TargetTest.cpp
index d53c062..9d61b52 100644
--- a/radio/1.0/vts/functional/VtsHalRadioV1_0TargetTest.cpp
+++ b/radio/1.0/vts/functional/VtsHalRadioV1_0TargetTest.cpp
@@ -14,12 +14,18 @@
* limitations under the License.
*/
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include <radio_hidl_hal_utils_v1_0.h>
+INSTANTIATE_TEST_SUITE_P(PerInstance, RadioHidlTest,
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ ::android::hardware::radio::V1_0::IRadio::descriptor)),
+ android::hardware::PrintInstanceNameToString);
+
int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(RadioHidlEnvironment::Instance());
::testing::InitGoogleTest(&argc, argv);
- RadioHidlEnvironment::Instance()->init(&argc, argv);
// setup seed for rand function
int seedSrand = time(NULL);
diff --git a/radio/1.0/vts/functional/VtsHalSapV1_0TargetTest.cpp b/radio/1.0/vts/functional/VtsHalSapV1_0TargetTest.cpp
index 859e6fb..b80b971 100644
--- a/radio/1.0/vts/functional/VtsHalSapV1_0TargetTest.cpp
+++ b/radio/1.0/vts/functional/VtsHalSapV1_0TargetTest.cpp
@@ -14,12 +14,18 @@
* limitations under the License.
*/
+#include <gtest/gtest.h>
+#include <hidl/GtestPrinter.h>
+#include <hidl/ServiceManagement.h>
#include <sap_hidl_hal_utils.h>
+INSTANTIATE_TEST_SUITE_P(PerInstance, SapHidlTest,
+ testing::ValuesIn(android::hardware::getAllHalInstanceNames(
+ ::android::hardware::radio::V1_0::ISap::descriptor)),
+ android::hardware::PrintInstanceNameToString);
+
int main(int argc, char** argv) {
- ::testing::AddGlobalTestEnvironment(SapHidlEnvironment::Instance());
::testing::InitGoogleTest(&argc, argv);
- SapHidlEnvironment::Instance()->init(&argc, argv);
// setup seed for rand function
int seedSrand = time(NULL);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
index 2c1eb60..125ea0c 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_cell_broadcast.cpp
@@ -21,7 +21,7 @@
/*
* Test IRadio.setGsmBroadcastConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, setGsmBroadcastConfig) {
+TEST_P(RadioHidlTest, setGsmBroadcastConfig) {
serial = GetRandomSerialNumber();
// Create GsmBroadcastSmsConfigInfo #1
@@ -84,7 +84,7 @@
/*
* Test IRadio.getGsmBroadcastConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, getGsmBroadcastConfig) {
+TEST_P(RadioHidlTest, getGsmBroadcastConfig) {
serial = GetRandomSerialNumber();
radio->getGsmBroadcastConfig(serial);
@@ -104,7 +104,7 @@
/*
* Test IRadio.setCdmaBroadcastConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, setCdmaBroadcastConfig) {
+TEST_P(RadioHidlTest, setCdmaBroadcastConfig) {
serial = GetRandomSerialNumber();
CdmaBroadcastSmsConfigInfo cbSmsConfig;
@@ -131,7 +131,7 @@
/*
* Test IRadio.getCdmaBroadcastConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, getCdmaBroadcastConfig) {
+TEST_P(RadioHidlTest, getCdmaBroadcastConfig) {
serial = GetRandomSerialNumber();
radio->getCdmaBroadcastConfig(serial);
@@ -149,7 +149,7 @@
/*
* Test IRadio.setCdmaBroadcastActivation() for the response returned.
*/
-TEST_F(RadioHidlTest, setCdmaBroadcastActivation) {
+TEST_P(RadioHidlTest, setCdmaBroadcastActivation) {
serial = GetRandomSerialNumber();
bool activate = false;
@@ -169,7 +169,7 @@
/*
* Test IRadio.setGsmBroadcastActivation() for the response returned.
*/
-TEST_F(RadioHidlTest, setGsmBroadcastActivation) {
+TEST_P(RadioHidlTest, setGsmBroadcastActivation) {
serial = GetRandomSerialNumber();
bool activate = false;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index eaef3ed..d937d74 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -21,7 +21,7 @@
/*
* Test IRadio.getDataRegistrationState() for the response returned.
*/
-TEST_F(RadioHidlTest, getDataRegistrationState) {
+TEST_P(RadioHidlTest, getDataRegistrationState) {
serial = GetRandomSerialNumber();
radio->getDataRegistrationState(serial);
@@ -99,7 +99,7 @@
/*
* Test IRadio.setupDataCall() for the response returned.
*/
-TEST_F(RadioHidlTest, setupDataCall) {
+TEST_P(RadioHidlTest, setupDataCall) {
serial = GetRandomSerialNumber();
RadioTechnology radioTechnology = RadioTechnology::LTE;
@@ -147,7 +147,7 @@
/*
* Test IRadio.deactivateDataCall() for the response returned.
*/
-TEST_F(RadioHidlTest, deactivateDataCall) {
+TEST_P(RadioHidlTest, deactivateDataCall) {
serial = GetRandomSerialNumber();
int cid = 1;
bool reasonRadioShutDown = false;
@@ -169,7 +169,7 @@
/*
* Test IRadio.getDataCallList() for the response returned.
*/
-TEST_F(RadioHidlTest, getDataCallList) {
+TEST_P(RadioHidlTest, getDataCallList) {
serial = GetRandomSerialNumber();
radio->getDataCallList(serial);
@@ -188,7 +188,7 @@
/*
* Test IRadio.setInitialAttachApn() for the response returned.
*/
-TEST_F(RadioHidlTest, setInitialAttachApn) {
+TEST_P(RadioHidlTest, setInitialAttachApn) {
serial = GetRandomSerialNumber();
DataProfileInfo dataProfileInfo;
@@ -231,7 +231,7 @@
/*
* Test IRadio.setDataAllowed() for the response returned.
*/
-TEST_F(RadioHidlTest, setDataAllowed) {
+TEST_P(RadioHidlTest, setDataAllowed) {
serial = GetRandomSerialNumber();
bool allow = true;
@@ -249,7 +249,7 @@
/*
* Test IRadio.setDataProfile() for the response returned.
*/
-TEST_F(RadioHidlTest, setDataProfile) {
+TEST_P(RadioHidlTest, setDataProfile) {
serial = GetRandomSerialNumber();
// Create a dataProfileInfo
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
index 2670d96..60cb2fe 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_icc.cpp
@@ -19,7 +19,7 @@
/*
* Test IRadio.getIccCardStatus() for the response returned.
*/
-TEST_F(RadioHidlTest, getIccCardStatus) {
+TEST_P(RadioHidlTest, getIccCardStatus) {
EXPECT_LE(cardStatus.applications.size(), (unsigned int)RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, (int)RadioConst::CARD_MAX_APPS);
@@ -29,7 +29,7 @@
/*
* Test IRadio.supplyIccPinForApp() for the response returned
*/
-TEST_F(RadioHidlTest, supplyIccPinForApp) {
+TEST_P(RadioHidlTest, supplyIccPinForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -54,7 +54,7 @@
/*
* Test IRadio.supplyIccPukForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, supplyIccPukForApp) {
+TEST_P(RadioHidlTest, supplyIccPukForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -78,7 +78,7 @@
/*
* Test IRadio.supplyIccPin2ForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, supplyIccPin2ForApp) {
+TEST_P(RadioHidlTest, supplyIccPin2ForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -104,7 +104,7 @@
/*
* Test IRadio.supplyIccPuk2ForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, supplyIccPuk2ForApp) {
+TEST_P(RadioHidlTest, supplyIccPuk2ForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -128,7 +128,7 @@
/*
* Test IRadio.changeIccPinForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, changeIccPinForApp) {
+TEST_P(RadioHidlTest, changeIccPinForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -153,7 +153,7 @@
/*
* Test IRadio.changeIccPin2ForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, changeIccPin2ForApp) {
+TEST_P(RadioHidlTest, changeIccPin2ForApp) {
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -179,7 +179,7 @@
/*
* Test IRadio.getImsiForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, getImsiForApp) {
+TEST_P(RadioHidlTest, getImsiForApp) {
serial = GetRandomSerialNumber();
// Check success returned while getting imsi for 3GPP and 3GPP2 apps only
@@ -208,7 +208,7 @@
/*
* Test IRadio.iccIOForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, iccIOForApp) {
+TEST_P(RadioHidlTest, iccIOForApp) {
serial = GetRandomSerialNumber();
for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
@@ -233,7 +233,7 @@
/*
* Test IRadio.iccTransmitApduBasicChannel() for the response returned.
*/
-TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
+TEST_P(RadioHidlTest, iccTransmitApduBasicChannel) {
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -250,7 +250,7 @@
/*
* Test IRadio.iccOpenLogicalChannel() for the response returned.
*/
-TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
+TEST_P(RadioHidlTest, iccOpenLogicalChannel) {
serial = GetRandomSerialNumber();
int p2 = 0x04;
// Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
@@ -265,7 +265,7 @@
/*
* Test IRadio.iccCloseLogicalChannel() for the response returned.
*/
-TEST_F(RadioHidlTest, iccCloseLogicalChannel) {
+TEST_P(RadioHidlTest, iccCloseLogicalChannel) {
serial = GetRandomSerialNumber();
// Try closing invalid channel and check INVALID_ARGUMENTS returned as error
radio->iccCloseLogicalChannel(serial, 0);
@@ -279,7 +279,7 @@
/*
* Test IRadio.iccTransmitApduLogicalChannel() for the response returned.
*/
-TEST_F(RadioHidlTest, iccTransmitApduLogicalChannel) {
+TEST_P(RadioHidlTest, iccTransmitApduLogicalChannel) {
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -296,7 +296,7 @@
/*
* Test IRadio.requestIccSimAuthentication() for the response returned.
*/
-TEST_F(RadioHidlTest, requestIccSimAuthentication) {
+TEST_P(RadioHidlTest, requestIccSimAuthentication) {
serial = GetRandomSerialNumber();
// Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
@@ -315,7 +315,7 @@
/*
* Test IRadio.supplyNetworkDepersonalization() for the response returned.
*/
-TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
+TEST_P(RadioHidlTest, supplyNetworkDepersonalization) {
serial = GetRandomSerialNumber();
radio->supplyNetworkDepersonalization(serial, hidl_string("test"));
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
index 4331c06..e253dcf 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_ims.cpp
@@ -21,7 +21,7 @@
/*
* Test IRadio.getClir() for the response returned.
*/
-TEST_F(RadioHidlTest, getClir) {
+TEST_P(RadioHidlTest, getClir) {
serial = GetRandomSerialNumber();
radio->getClir(serial);
@@ -39,7 +39,7 @@
/*
* Test IRadio.setClir() for the response returned.
*/
-TEST_F(RadioHidlTest, setClir) {
+TEST_P(RadioHidlTest, setClir) {
serial = GetRandomSerialNumber();
int32_t status = 1;
@@ -57,7 +57,7 @@
/*
* Test IRadio.getFacilityLockForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, getFacilityLockForApp) {
+TEST_P(RadioHidlTest, getFacilityLockForApp) {
serial = GetRandomSerialNumber();
std::string facility = "";
std::string password = "";
@@ -80,7 +80,7 @@
/*
* Test IRadio.setFacilityLockForApp() for the response returned.
*/
-TEST_F(RadioHidlTest, setFacilityLockForApp) {
+TEST_P(RadioHidlTest, setFacilityLockForApp) {
serial = GetRandomSerialNumber();
std::string facility = "";
bool lockState = false;
@@ -104,7 +104,7 @@
/*
* Test IRadio.setBarringPassword() for the response returned.
*/
-TEST_F(RadioHidlTest, setBarringPassword) {
+TEST_P(RadioHidlTest, setBarringPassword) {
serial = GetRandomSerialNumber();
std::string facility = "";
std::string oldPassword = "";
@@ -127,7 +127,7 @@
/*
* Test IRadio.getClip() for the response returned.
*/
-TEST_F(RadioHidlTest, getClip) {
+TEST_P(RadioHidlTest, getClip) {
serial = GetRandomSerialNumber();
radio->getClip(serial);
@@ -145,7 +145,7 @@
/*
* Test IRadio.setSuppServiceNotifications() for the response returned.
*/
-TEST_F(RadioHidlTest, setSuppServiceNotifications) {
+TEST_P(RadioHidlTest, setSuppServiceNotifications) {
serial = GetRandomSerialNumber();
bool enable = false;
@@ -164,7 +164,7 @@
/*
* Test IRadio.requestIsimAuthentication() for the response returned.
*/
-TEST_F(RadioHidlTest, requestIsimAuthentication) {
+TEST_P(RadioHidlTest, requestIsimAuthentication) {
serial = GetRandomSerialNumber();
std::string challenge = "";
@@ -186,7 +186,7 @@
/*
* Test IRadio.getImsRegistrationState() for the response returned.
*/
-TEST_F(RadioHidlTest, getImsRegistrationState) {
+TEST_P(RadioHidlTest, getImsRegistrationState) {
serial = GetRandomSerialNumber();
radio->getImsRegistrationState(serial);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 3499762..d04cb36 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -19,7 +19,7 @@
/*
* Test IRadio.getSignalStrength() for the response returned.
*/
-TEST_F(RadioHidlTest, getSignalStrength) {
+TEST_P(RadioHidlTest, getSignalStrength) {
serial = GetRandomSerialNumber();
radio->getSignalStrength(serial);
@@ -35,7 +35,7 @@
/*
* Test IRadio.getVoiceRegistrationState() for the response returned.
*/
-TEST_F(RadioHidlTest, getVoiceRegistrationState) {
+TEST_P(RadioHidlTest, getVoiceRegistrationState) {
serial = GetRandomSerialNumber();
radio->getVoiceRegistrationState(serial);
@@ -51,7 +51,7 @@
/*
* Test IRadio.getOperator() for the response returned.
*/
-TEST_F(RadioHidlTest, getOperator) {
+TEST_P(RadioHidlTest, getOperator) {
serial = GetRandomSerialNumber();
radio->getOperator(serial);
@@ -67,7 +67,7 @@
/*
* Test IRadio.setRadioPower() for the response returned.
*/
-TEST_F(RadioHidlTest, setRadioPower) {
+TEST_P(RadioHidlTest, setRadioPower) {
serial = GetRandomSerialNumber();
radio->setRadioPower(serial, 1);
@@ -83,7 +83,7 @@
/*
* Test IRadio.getNetworkSelectionMode() for the response returned.
*/
-TEST_F(RadioHidlTest, getNetworkSelectionMode) {
+TEST_P(RadioHidlTest, getNetworkSelectionMode) {
serial = GetRandomSerialNumber();
radio->getNetworkSelectionMode(serial);
@@ -99,7 +99,7 @@
/*
* Test IRadio.setNetworkSelectionModeAutomatic() for the response returned.
*/
-TEST_F(RadioHidlTest, setNetworkSelectionModeAutomatic) {
+TEST_P(RadioHidlTest, setNetworkSelectionModeAutomatic) {
serial = GetRandomSerialNumber();
radio->setNetworkSelectionModeAutomatic(serial);
@@ -118,7 +118,7 @@
/*
* Test IRadio.setNetworkSelectionModeManual() for the response returned.
*/
-TEST_F(RadioHidlTest, setNetworkSelectionModeManual) {
+TEST_P(RadioHidlTest, setNetworkSelectionModeManual) {
serial = GetRandomSerialNumber();
radio->setNetworkSelectionModeManual(serial, "123456");
@@ -137,7 +137,7 @@
/*
* Test IRadio.getAvailableNetworks() for the response returned.
*/
-TEST_F(RadioHidlTest, getAvailableNetworks) {
+TEST_P(RadioHidlTest, getAvailableNetworks) {
serial = GetRandomSerialNumber();
radio->getAvailableNetworks(serial);
@@ -158,7 +158,7 @@
/*
* Test IRadio.getBasebandVersion() for the response returned.
*/
-TEST_F(RadioHidlTest, getBasebandVersion) {
+TEST_P(RadioHidlTest, getBasebandVersion) {
serial = GetRandomSerialNumber();
radio->getBasebandVersion(serial);
@@ -174,7 +174,7 @@
/*
* Test IRadio.setBandMode() for the response returned.
*/
-TEST_F(RadioHidlTest, setBandMode) {
+TEST_P(RadioHidlTest, setBandMode) {
serial = GetRandomSerialNumber();
radio->setBandMode(serial, RadioBandMode::BAND_MODE_USA);
@@ -191,7 +191,7 @@
/*
* Test IRadio.getAvailableBandModes() for the response returned.
*/
-TEST_F(RadioHidlTest, getAvailableBandModes) {
+TEST_P(RadioHidlTest, getAvailableBandModes) {
serial = GetRandomSerialNumber();
radio->getAvailableBandModes(serial);
@@ -207,7 +207,7 @@
/*
* Test IRadio.setPreferredNetworkType() for the response returned.
*/
-TEST_F(RadioHidlTest, setPreferredNetworkType) {
+TEST_P(RadioHidlTest, setPreferredNetworkType) {
serial = GetRandomSerialNumber();
radio->setPreferredNetworkType(serial, PreferredNetworkType::GSM_ONLY);
@@ -224,7 +224,7 @@
/*
* Test IRadio.getPreferredNetworkType() for the response returned.
*/
-TEST_F(RadioHidlTest, getPreferredNetworkType) {
+TEST_P(RadioHidlTest, getPreferredNetworkType) {
serial = GetRandomSerialNumber();
radio->getPreferredNetworkType(serial);
@@ -240,7 +240,7 @@
/*
* Test IRadio.getNeighboringCids() for the response returned.
*/
-TEST_F(RadioHidlTest, getNeighboringCids) {
+TEST_P(RadioHidlTest, getNeighboringCids) {
serial = GetRandomSerialNumber();
radio->getNeighboringCids(serial);
@@ -258,7 +258,7 @@
/*
* Test IRadio.setLocationUpdates() for the response returned.
*/
-TEST_F(RadioHidlTest, setLocationUpdates) {
+TEST_P(RadioHidlTest, setLocationUpdates) {
serial = GetRandomSerialNumber();
radio->setLocationUpdates(serial, true);
@@ -275,7 +275,7 @@
/*
* Test IRadio.setCdmaRoamingPreference() for the response returned.
*/
-TEST_F(RadioHidlTest, setCdmaRoamingPreference) {
+TEST_P(RadioHidlTest, setCdmaRoamingPreference) {
serial = GetRandomSerialNumber();
radio->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK);
@@ -293,7 +293,7 @@
/*
* Test IRadio.getCdmaRoamingPreference() for the response returned.
*/
-TEST_F(RadioHidlTest, getCdmaRoamingPreference) {
+TEST_P(RadioHidlTest, getCdmaRoamingPreference) {
serial = GetRandomSerialNumber();
radio->getCdmaRoamingPreference(serial);
@@ -312,7 +312,7 @@
/*
* Test IRadio.getTTYMode() for the response returned.
*/
-TEST_F(RadioHidlTest, getTTYMode) {
+TEST_P(RadioHidlTest, getTTYMode) {
serial = GetRandomSerialNumber();
radio->getTTYMode(serial);
@@ -328,7 +328,7 @@
/*
* Test IRadio.setTTYMode() for the response returned.
*/
-TEST_F(RadioHidlTest, setTTYMode) {
+TEST_P(RadioHidlTest, setTTYMode) {
serial = GetRandomSerialNumber();
radio->setTTYMode(serial, TtyMode::OFF);
@@ -344,7 +344,7 @@
/*
* Test IRadio.setPreferredVoicePrivacy() for the response returned.
*/
-TEST_F(RadioHidlTest, setPreferredVoicePrivacy) {
+TEST_P(RadioHidlTest, setPreferredVoicePrivacy) {
serial = GetRandomSerialNumber();
radio->setPreferredVoicePrivacy(serial, true);
@@ -361,7 +361,7 @@
/*
* Test IRadio.getPreferredVoicePrivacy() for the response returned.
*/
-TEST_F(RadioHidlTest, getPreferredVoicePrivacy) {
+TEST_P(RadioHidlTest, getPreferredVoicePrivacy) {
serial = GetRandomSerialNumber();
radio->getPreferredVoicePrivacy(serial);
@@ -378,7 +378,7 @@
/*
* Test IRadio.getCDMASubscription() for the response returned.
*/
-TEST_F(RadioHidlTest, getCDMASubscription) {
+TEST_P(RadioHidlTest, getCDMASubscription) {
serial = GetRandomSerialNumber();
radio->getCDMASubscription(serial);
@@ -396,7 +396,7 @@
/*
* Test IRadio.getDeviceIdentity() for the response returned.
*/
-TEST_F(RadioHidlTest, getDeviceIdentity) {
+TEST_P(RadioHidlTest, getDeviceIdentity) {
serial = GetRandomSerialNumber();
radio->getDeviceIdentity(serial);
@@ -413,7 +413,7 @@
/*
* Test IRadio.exitEmergencyCallbackMode() for the response returned.
*/
-TEST_F(RadioHidlTest, exitEmergencyCallbackMode) {
+TEST_P(RadioHidlTest, exitEmergencyCallbackMode) {
serial = GetRandomSerialNumber();
radio->exitEmergencyCallbackMode(serial);
@@ -431,7 +431,7 @@
/*
* Test IRadio.getCdmaSubscriptionSource() for the response returned.
*/
-TEST_F(RadioHidlTest, getCdmaSubscriptionSource) {
+TEST_P(RadioHidlTest, getCdmaSubscriptionSource) {
serial = GetRandomSerialNumber();
radio->getCdmaSubscriptionSource(serial);
@@ -449,7 +449,7 @@
/*
* Test IRadio.setCdmaSubscriptionSource() for the response returned.
*/
-TEST_F(RadioHidlTest, setCdmaSubscriptionSource) {
+TEST_P(RadioHidlTest, setCdmaSubscriptionSource) {
serial = GetRandomSerialNumber();
radio->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
@@ -468,7 +468,7 @@
/*
* Test IRadio.getVoiceRadioTechnology() for the response returned.
*/
-TEST_F(RadioHidlTest, getVoiceRadioTechnology) {
+TEST_P(RadioHidlTest, getVoiceRadioTechnology) {
serial = GetRandomSerialNumber();
radio->getVoiceRadioTechnology(serial);
@@ -484,7 +484,7 @@
/*
* Test IRadio.getCellInfoList() for the response returned.
*/
-TEST_F(RadioHidlTest, getCellInfoList) {
+TEST_P(RadioHidlTest, getCellInfoList) {
serial = GetRandomSerialNumber();
radio->getCellInfoList(serial);
@@ -502,7 +502,7 @@
/*
* Test IRadio.setCellInfoListRate() for the response returned.
*/
-TEST_F(RadioHidlTest, setCellInfoListRate) {
+TEST_P(RadioHidlTest, setCellInfoListRate) {
serial = GetRandomSerialNumber();
// TODO(sanketpadawe): RIL crashes with value of rate = 10
@@ -520,7 +520,7 @@
/*
* Test IRadio.nvReadItem() for the response returned.
*/
-TEST_F(RadioHidlTest, nvReadItem) {
+TEST_P(RadioHidlTest, nvReadItem) {
serial = GetRandomSerialNumber();
radio->nvReadItem(serial, NvItem::LTE_BAND_ENABLE_25);
@@ -537,7 +537,7 @@
/*
* Test IRadio.nvWriteItem() for the response returned.
*/
-TEST_F(RadioHidlTest, nvWriteItem) {
+TEST_P(RadioHidlTest, nvWriteItem) {
serial = GetRandomSerialNumber();
NvWriteItem item;
memset(&item, 0, sizeof(item));
@@ -557,7 +557,7 @@
/*
* Test IRadio.nvWriteCdmaPrl() for the response returned.
*/
-TEST_F(RadioHidlTest, nvWriteCdmaPrl) {
+TEST_P(RadioHidlTest, nvWriteCdmaPrl) {
serial = GetRandomSerialNumber();
std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
@@ -575,7 +575,7 @@
/*
* Test IRadio.nvResetConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, nvResetConfig) {
+TEST_P(RadioHidlTest, nvResetConfig) {
serial = GetRandomSerialNumber();
radio->nvResetConfig(serial, ResetNvType::ERASE);
@@ -592,7 +592,7 @@
/*
* Test IRadio.setUiccSubscription() for the response returned.
*/
-TEST_F(RadioHidlTest, setUiccSubscription) {
+TEST_P(RadioHidlTest, setUiccSubscription) {
serial = GetRandomSerialNumber();
SelectUiccSub item;
memset(&item, 0, sizeof(item));
@@ -614,7 +614,7 @@
/*
* Test IRadio.getHardwareConfig() for the response returned.
*/
-TEST_F(RadioHidlTest, getHardwareConfig) {
+TEST_P(RadioHidlTest, getHardwareConfig) {
serial = GetRandomSerialNumber();
radio->getHardwareConfig(serial);
@@ -631,7 +631,7 @@
/*
* Test IRadio.requestShutdown() for the response returned.
*/
-TEST_F(RadioHidlTest, requestShutdown) {
+TEST_P(RadioHidlTest, requestShutdown) {
serial = GetRandomSerialNumber();
radio->requestShutdown(serial);
@@ -648,7 +648,7 @@
/*
* Test IRadio.getRadioCapability() for the response returned.
*/
-TEST_F(RadioHidlTest, getRadioCapability) {
+TEST_P(RadioHidlTest, getRadioCapability) {
serial = GetRandomSerialNumber();
radio->getRadioCapability(serial);
@@ -664,7 +664,7 @@
/*
* Test IRadio.setRadioCapability() for the response returned.
*/
-TEST_F(RadioHidlTest, setRadioCapability) {
+TEST_P(RadioHidlTest, setRadioCapability) {
serial = GetRandomSerialNumber();
RadioCapability rc;
memset(&rc, 0, sizeof(rc));
@@ -685,7 +685,7 @@
/*
* Test IRadio.startLceService() for the response returned.
*/
-TEST_F(RadioHidlTest, startLceService) {
+TEST_P(RadioHidlTest, startLceService) {
serial = GetRandomSerialNumber();
radio->startLceService(serial, 5, true);
@@ -704,7 +704,7 @@
/*
* Test IRadio.stopLceService() for the response returned.
*/
-TEST_F(RadioHidlTest, stopLceService) {
+TEST_P(RadioHidlTest, stopLceService) {
serial = GetRandomSerialNumber();
radio->stopLceService(serial);
@@ -722,7 +722,7 @@
/*
* Test IRadio.pullLceData() for the response returned.
*/
-TEST_F(RadioHidlTest, pullLceData) {
+TEST_P(RadioHidlTest, pullLceData) {
serial = GetRandomSerialNumber();
radio->pullLceData(serial);
@@ -741,7 +741,7 @@
/*
* Test IRadio.getModemActivityInfo() for the response returned.
*/
-TEST_F(RadioHidlTest, getModemActivityInfo) {
+TEST_P(RadioHidlTest, getModemActivityInfo) {
serial = GetRandomSerialNumber();
radio->getModemActivityInfo(serial);
@@ -758,7 +758,7 @@
/*
* Test IRadio.setAllowedCarriers() for the response returned.
*/
-TEST_F(RadioHidlTest, setAllowedCarriers) {
+TEST_P(RadioHidlTest, setAllowedCarriers) {
serial = GetRandomSerialNumber();
CarrierRestrictions carriers;
memset(&carriers, 0, sizeof(carriers));
@@ -835,7 +835,7 @@
/*
* Test IRadio.getAllowedCarriers() for the response returned.
*/
-TEST_F(RadioHidlTest, getAllowedCarriers) {
+TEST_P(RadioHidlTest, getAllowedCarriers) {
serial = GetRandomSerialNumber();
radio->getAllowedCarriers(serial);
@@ -852,7 +852,7 @@
/*
* Test IRadio.sendDeviceState() for the response returned.
*/
-TEST_F(RadioHidlTest, sendDeviceState) {
+TEST_P(RadioHidlTest, sendDeviceState) {
serial = GetRandomSerialNumber();
radio->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true);
@@ -871,7 +871,7 @@
/*
* Test IRadio.setIndicationFilter() for the response returned.
*/
-TEST_F(RadioHidlTest, setIndicationFilter) {
+TEST_P(RadioHidlTest, setIndicationFilter) {
serial = GetRandomSerialNumber();
radio->setIndicationFilter(serial, 1);
@@ -890,7 +890,7 @@
/*
* Test IRadio.setSimCardPower() for the response returned.
*/
-TEST_F(RadioHidlTest, setSimCardPower) {
+TEST_P(RadioHidlTest, setSimCardPower) {
serial = GetRandomSerialNumber();
radio->setSimCardPower(serial, true);
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
index 9e41429..58c3bbd 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_sms.cpp
@@ -21,7 +21,7 @@
/*
* Test IRadio.sendSms() for the response returned.
*/
-TEST_F(RadioHidlTest, sendSms) {
+TEST_P(RadioHidlTest, sendSms) {
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -45,7 +45,7 @@
/*
* Test IRadio.sendSMSExpectMore() for the response returned.
*/
-TEST_F(RadioHidlTest, sendSMSExpectMore) {
+TEST_P(RadioHidlTest, sendSMSExpectMore) {
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -71,7 +71,7 @@
/*
* Test IRadio.acknowledgeLastIncomingGsmSms() for the response returned.
*/
-TEST_F(RadioHidlTest, acknowledgeLastIncomingGsmSms) {
+TEST_P(RadioHidlTest, acknowledgeLastIncomingGsmSms) {
serial = GetRandomSerialNumber();
bool success = true;
@@ -92,7 +92,7 @@
/*
* Test IRadio.acknowledgeIncomingGsmSmsWithPdu() for the response returned.
*/
-TEST_F(RadioHidlTest, acknowledgeIncomingGsmSmsWithPdu) {
+TEST_P(RadioHidlTest, acknowledgeIncomingGsmSmsWithPdu) {
serial = GetRandomSerialNumber();
bool success = true;
std::string ackPdu = "";
@@ -111,7 +111,7 @@
/*
* Test IRadio.sendCdmaSms() for the response returned.
*/
-TEST_F(RadioHidlTest, sendCdmaSms) {
+TEST_P(RadioHidlTest, sendCdmaSms) {
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -155,7 +155,7 @@
/*
* Test IRadio.acknowledgeLastIncomingCdmaSms() for the response returned.
*/
-TEST_F(RadioHidlTest, acknowledgeLastIncomingCdmaSms) {
+TEST_P(RadioHidlTest, acknowledgeLastIncomingCdmaSms) {
serial = GetRandomSerialNumber();
// Create a CdmaSmsAck
@@ -179,7 +179,7 @@
/*
* Test IRadio.sendImsSms() for the response returned.
*/
-TEST_F(RadioHidlTest, sendImsSms) {
+TEST_P(RadioHidlTest, sendImsSms) {
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -229,7 +229,7 @@
/*
* Test IRadio.getSmscAddress() for the response returned.
*/
-TEST_F(RadioHidlTest, getSmscAddress) {
+TEST_P(RadioHidlTest, getSmscAddress) {
serial = GetRandomSerialNumber();
radio->getSmscAddress(serial);
@@ -249,7 +249,7 @@
/*
* Test IRadio.setSmscAddress() for the response returned.
*/
-TEST_F(RadioHidlTest, setSmscAddress) {
+TEST_P(RadioHidlTest, setSmscAddress) {
serial = GetRandomSerialNumber();
hidl_string address = hidl_string("smscAddress");
@@ -270,7 +270,7 @@
/*
* Test IRadio.writeSmsToSim() for the response returned.
*/
-TEST_F(RadioHidlTest, writeSmsToSim) {
+TEST_P(RadioHidlTest, writeSmsToSim) {
serial = GetRandomSerialNumber();
SmsWriteArgs smsWriteArgs;
smsWriteArgs.status = SmsWriteArgsStatus::REC_UNREAD;
@@ -296,7 +296,7 @@
/*
* Test IRadio.deleteSmsOnSim() for the response returned.
*/
-TEST_F(RadioHidlTest, deleteSmsOnSim) {
+TEST_P(RadioHidlTest, deleteSmsOnSim) {
serial = GetRandomSerialNumber();
int index = 1;
@@ -319,7 +319,7 @@
/*
* Test IRadio.writeSmsToRuim() for the response returned.
*/
-TEST_F(RadioHidlTest, writeSmsToRuim) {
+TEST_P(RadioHidlTest, writeSmsToRuim) {
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -370,7 +370,7 @@
/*
* Test IRadio.deleteSmsOnRuim() for the response returned.
*/
-TEST_F(RadioHidlTest, deleteSmsOnRuim) {
+TEST_P(RadioHidlTest, deleteSmsOnRuim) {
serial = GetRandomSerialNumber();
int index = 1;
@@ -421,7 +421,7 @@
/*
* Test IRadio.reportSmsMemoryStatus() for the response returned.
*/
-TEST_F(RadioHidlTest, reportSmsMemoryStatus) {
+TEST_P(RadioHidlTest, reportSmsMemoryStatus) {
serial = GetRandomSerialNumber();
bool available = true;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
index a3b5029..1170111 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_stk.cpp
@@ -21,7 +21,7 @@
/*
* Test IRadio.sendEnvelope() for the response returned.
*/
-TEST_F(RadioHidlTest, sendEnvelope) {
+TEST_P(RadioHidlTest, sendEnvelope) {
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -44,7 +44,7 @@
/*
* Test IRadio.sendTerminalResponseToSim() for the response returned.
*/
-TEST_F(RadioHidlTest, sendTerminalResponseToSim) {
+TEST_P(RadioHidlTest, sendTerminalResponseToSim) {
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -67,7 +67,7 @@
/*
* Test IRadio.handleStkCallSetupRequestFromSim() for the response returned.
*/
-TEST_F(RadioHidlTest, handleStkCallSetupRequestFromSim) {
+TEST_P(RadioHidlTest, handleStkCallSetupRequestFromSim) {
serial = GetRandomSerialNumber();
bool accept = false;
@@ -88,7 +88,7 @@
/*
* Test IRadio.reportStkServiceIsRunning() for the response returned.
*/
-TEST_F(RadioHidlTest, reportStkServiceIsRunning) {
+TEST_P(RadioHidlTest, reportStkServiceIsRunning) {
serial = GetRandomSerialNumber();
radio->reportStkServiceIsRunning(serial);
@@ -107,7 +107,7 @@
* Test IRadio.sendEnvelopeWithStatus() for the response returned with empty
* string.
*/
-TEST_F(RadioHidlTest, sendEnvelopeWithStatus) {
+TEST_P(RadioHidlTest, sendEnvelopeWithStatus) {
serial = GetRandomSerialNumber();
// Test with sending empty string
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
index 96719d6..3c833c0 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_test.cpp
@@ -17,13 +17,10 @@
#include <radio_hidl_hal_utils_v1_0.h>
void RadioHidlTest::SetUp() {
- radio = ::testing::VtsHalHidlTargetTestBase::getService<IRadio>(
- RadioHidlEnvironment::Instance()->getServiceName<IRadio>(hidl_string(RADIO_SERVICE_NAME)));
+ radio = IRadio::getService(GetParam());
if (radio == NULL) {
sleep(60);
- radio = ::testing::VtsHalHidlTargetTestBase::getService<IRadio>(
- RadioHidlEnvironment::Instance()->getServiceName<IRadio>(
- hidl_string(RADIO_SERVICE_NAME)));
+ radio = IRadio::getService(GetParam());
}
ASSERT_NE(nullptr, radio.get());
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
index 23bc434..8a551f7 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
+++ b/radio/1.0/vts/functional/radio_hidl_hal_utils_v1_0.h
@@ -16,8 +16,6 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -26,6 +24,7 @@
#include <android/hardware/radio/1.0/IRadioIndication.h>
#include <android/hardware/radio/1.0/IRadioResponse.h>
#include <android/hardware/radio/1.0/types.h>
+#include <gtest/gtest.h>
#include "vts_test_util.h"
@@ -515,23 +514,9 @@
const ::android::hardware::hidl_string& reason);
};
-// Test environment for Radio HIDL HAL.
-class RadioHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static RadioHidlEnvironment* Instance() {
- static RadioHidlEnvironment* instance = new RadioHidlEnvironment;
- return instance;
- }
- virtual void registerTestServices() override { registerTestService<IRadio>(); }
-
- private:
- RadioHidlEnvironment() {}
-};
-
// The main test class for Radio HIDL.
-class RadioHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- protected:
+class RadioHidlTest : public ::testing::TestWithParam<std::string> {
+ protected:
std::mutex mtx;
std::condition_variable cv;
int count;
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
index 1fce470..a192a33 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_voice.cpp
@@ -19,7 +19,7 @@
/*
* Test IRadio.getCurrentCalls() for the response returned.
*/
-TEST_F(RadioHidlTest, getCurrentCalls) {
+TEST_P(RadioHidlTest, getCurrentCalls) {
serial = GetRandomSerialNumber();
radio->getCurrentCalls(serial);
@@ -35,7 +35,7 @@
/*
* Test IRadio.dial() for the response returned.
*/
-TEST_F(RadioHidlTest, dial) {
+TEST_P(RadioHidlTest, dial) {
serial = GetRandomSerialNumber();
Dial dialInfo;
@@ -62,7 +62,7 @@
/*
* Test IRadio.hangup() for the response returned.
*/
-TEST_F(RadioHidlTest, hangup) {
+TEST_P(RadioHidlTest, hangup) {
serial = GetRandomSerialNumber();
radio->hangup(serial, 1);
@@ -81,7 +81,7 @@
/*
* Test IRadio.hangupWaitingOrBackground() for the response returned.
*/
-TEST_F(RadioHidlTest, hangupWaitingOrBackground) {
+TEST_P(RadioHidlTest, hangupWaitingOrBackground) {
serial = GetRandomSerialNumber();
radio->hangupWaitingOrBackground(serial);
@@ -99,7 +99,7 @@
/*
* Test IRadio.hangupForegroundResumeBackground() for the response returned.
*/
-TEST_F(RadioHidlTest, hangupForegroundResumeBackground) {
+TEST_P(RadioHidlTest, hangupForegroundResumeBackground) {
serial = GetRandomSerialNumber();
radio->hangupForegroundResumeBackground(serial);
@@ -117,7 +117,7 @@
/*
* Test IRadio.switchWaitingOrHoldingAndActive() for the response returned.
*/
-TEST_F(RadioHidlTest, switchWaitingOrHoldingAndActive) {
+TEST_P(RadioHidlTest, switchWaitingOrHoldingAndActive) {
serial = GetRandomSerialNumber();
radio->switchWaitingOrHoldingAndActive(serial);
@@ -135,7 +135,7 @@
/*
* Test IRadio.conference() for the response returned.
*/
-TEST_F(RadioHidlTest, conference) {
+TEST_P(RadioHidlTest, conference) {
serial = GetRandomSerialNumber();
radio->conference(serial);
@@ -153,7 +153,7 @@
/*
* Test IRadio.rejectCall() for the response returned.
*/
-TEST_F(RadioHidlTest, rejectCall) {
+TEST_P(RadioHidlTest, rejectCall) {
serial = GetRandomSerialNumber();
radio->rejectCall(serial);
@@ -171,7 +171,7 @@
/*
* Test IRadio.getLastCallFailCause() for the response returned.
*/
-TEST_F(RadioHidlTest, getLastCallFailCause) {
+TEST_P(RadioHidlTest, getLastCallFailCause) {
serial = GetRandomSerialNumber();
radio->getLastCallFailCause(serial);
@@ -188,7 +188,7 @@
/*
* Test IRadio.sendUssd() for the response returned.
*/
-TEST_F(RadioHidlTest, sendUssd) {
+TEST_P(RadioHidlTest, sendUssd) {
serial = GetRandomSerialNumber();
radio->sendUssd(serial, hidl_string("test"));
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -206,7 +206,7 @@
/*
* Test IRadio.cancelPendingUssd() for the response returned.
*/
-TEST_F(RadioHidlTest, cancelPendingUssd) {
+TEST_P(RadioHidlTest, cancelPendingUssd) {
serial = GetRandomSerialNumber();
radio->cancelPendingUssd(serial);
@@ -225,7 +225,7 @@
/*
* Test IRadio.getCallForwardStatus() for the response returned.
*/
-TEST_F(RadioHidlTest, getCallForwardStatus) {
+TEST_P(RadioHidlTest, getCallForwardStatus) {
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -247,7 +247,7 @@
/*
* Test IRadio.setCallForward() for the response returned.
*/
-TEST_F(RadioHidlTest, setCallForward) {
+TEST_P(RadioHidlTest, setCallForward) {
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -269,7 +269,7 @@
/*
* Test IRadio.getCallWaiting() for the response returned.
*/
-TEST_F(RadioHidlTest, getCallWaiting) {
+TEST_P(RadioHidlTest, getCallWaiting) {
serial = GetRandomSerialNumber();
radio->getCallWaiting(serial, 1);
@@ -288,7 +288,7 @@
/*
* Test IRadio.setCallWaiting() for the response returned.
*/
-TEST_F(RadioHidlTest, setCallWaiting) {
+TEST_P(RadioHidlTest, setCallWaiting) {
serial = GetRandomSerialNumber();
radio->setCallWaiting(serial, true, 1);
@@ -307,7 +307,7 @@
/*
* Test IRadio.acceptCall() for the response returned.
*/
-TEST_F(RadioHidlTest, acceptCall) {
+TEST_P(RadioHidlTest, acceptCall) {
serial = GetRandomSerialNumber();
radio->acceptCall(serial);
@@ -325,7 +325,7 @@
/*
* Test IRadio.separateConnection() for the response returned.
*/
-TEST_F(RadioHidlTest, separateConnection) {
+TEST_P(RadioHidlTest, separateConnection) {
serial = GetRandomSerialNumber();
radio->separateConnection(serial, 1);
@@ -344,7 +344,7 @@
/*
* Test IRadio.explicitCallTransfer() for the response returned.
*/
-TEST_F(RadioHidlTest, explicitCallTransfer) {
+TEST_P(RadioHidlTest, explicitCallTransfer) {
serial = GetRandomSerialNumber();
radio->explicitCallTransfer(serial);
@@ -362,7 +362,7 @@
/*
* Test IRadio.sendCDMAFeatureCode() for the response returned.
*/
-TEST_F(RadioHidlTest, sendCDMAFeatureCode) {
+TEST_P(RadioHidlTest, sendCDMAFeatureCode) {
serial = GetRandomSerialNumber();
radio->sendCDMAFeatureCode(serial, hidl_string());
@@ -382,7 +382,7 @@
/*
* Test IRadio.sendDtmf() for the response returned.
*/
-TEST_F(RadioHidlTest, sendDtmf) {
+TEST_P(RadioHidlTest, sendDtmf) {
serial = GetRandomSerialNumber();
radio->sendDtmf(serial, "1");
@@ -402,7 +402,7 @@
/*
* Test IRadio.startDtmf() for the response returned.
*/
-TEST_F(RadioHidlTest, startDtmf) {
+TEST_P(RadioHidlTest, startDtmf) {
serial = GetRandomSerialNumber();
radio->startDtmf(serial, "1");
@@ -422,7 +422,7 @@
/*
* Test IRadio.stopDtmf() for the response returned.
*/
-TEST_F(RadioHidlTest, stopDtmf) {
+TEST_P(RadioHidlTest, stopDtmf) {
serial = GetRandomSerialNumber();
radio->stopDtmf(serial);
@@ -441,7 +441,7 @@
/*
* Test IRadio.setMute() for the response returned.
*/
-TEST_F(RadioHidlTest, setMute) {
+TEST_P(RadioHidlTest, setMute) {
serial = GetRandomSerialNumber();
radio->setMute(serial, true);
@@ -459,7 +459,7 @@
/*
* Test IRadio.getMute() for the response returned.
*/
-TEST_F(RadioHidlTest, getMute) {
+TEST_P(RadioHidlTest, getMute) {
serial = GetRandomSerialNumber();
radio->getMute(serial);
@@ -475,7 +475,7 @@
/*
* Test IRadio.sendBurstDtmf() for the response returned.
*/
-TEST_F(RadioHidlTest, sendBurstDtmf) {
+TEST_P(RadioHidlTest, sendBurstDtmf) {
serial = GetRandomSerialNumber();
radio->sendBurstDtmf(serial, "1", 0, 0);
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
index 1d79ff6..6bd2c88 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
+++ b/radio/1.0/vts/functional/sap_hidl_hal_api.cpp
@@ -19,7 +19,7 @@
/*
* Test ISap.connectReq() for the response returned.
*/
-TEST_F(SapHidlTest, connectReq) {
+TEST_P(SapHidlTest, connectReq) {
token = GetRandomSerialNumber();
int32_t maxMsgSize = 100;
@@ -35,7 +35,7 @@
/*
* Test IRadio.disconnectReq() for the response returned
*/
-TEST_F(SapHidlTest, disconnectReq) {
+TEST_P(SapHidlTest, disconnectReq) {
token = GetRandomSerialNumber();
sap->disconnectReq(token);
@@ -46,7 +46,7 @@
/*
* Test IRadio.apduReq() for the response returned.
*/
-TEST_F(SapHidlTest, apduReq) {
+TEST_P(SapHidlTest, apduReq) {
token = GetRandomSerialNumber();
SapApduType sapApduType = SapApduType::APDU;
android::hardware::hidl_vec<uint8_t> command = {};
@@ -64,7 +64,7 @@
/*
* Test IRadio.transferAtrReq() for the response returned.
*/
-TEST_F(SapHidlTest, transferAtrReq) {
+TEST_P(SapHidlTest, transferAtrReq) {
token = GetRandomSerialNumber();
sap->transferAtrReq(token);
@@ -80,7 +80,7 @@
/*
* Test IRadio.powerReq() for the response returned.
*/
-TEST_F(SapHidlTest, powerReq) {
+TEST_P(SapHidlTest, powerReq) {
token = GetRandomSerialNumber();
bool state = true;
@@ -97,7 +97,7 @@
/*
* Test IRadio.resetSimReq() for the response returned.
*/
-TEST_F(SapHidlTest, resetSimReq) {
+TEST_P(SapHidlTest, resetSimReq) {
token = GetRandomSerialNumber();
sap->resetSimReq(token);
@@ -113,7 +113,7 @@
/*
* Test IRadio.transferCardReaderStatusReq() for the response returned.
*/
-TEST_F(SapHidlTest, transferCardReaderStatusReq) {
+TEST_P(SapHidlTest, transferCardReaderStatusReq) {
token = GetRandomSerialNumber();
sap->transferCardReaderStatusReq(token);
@@ -127,7 +127,7 @@
/*
* Test IRadio.setTransferProtocolReq() for the response returned.
*/
-TEST_F(SapHidlTest, setTransferProtocolReq) {
+TEST_P(SapHidlTest, setTransferProtocolReq) {
token = GetRandomSerialNumber();
SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0;
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
index 65b344b..fe10587 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
+++ b/radio/1.0/vts/functional/sap_hidl_hal_test.cpp
@@ -17,8 +17,7 @@
#include <sap_hidl_hal_utils.h>
void SapHidlTest::SetUp() {
- sap = ::testing::VtsHalHidlTargetTestBase::getService<ISap>(
- SapHidlEnvironment::Instance()->getServiceName<ISap>(hidl_string(SAP_SERVICE_NAME)));
+ sap = ISap::getService(GetParam());
ASSERT_NE(sap, nullptr);
sapCb = new SapCallback(*this);
diff --git a/radio/1.0/vts/functional/sap_hidl_hal_utils.h b/radio/1.0/vts/functional/sap_hidl_hal_utils.h
index f432932..2fc9ae3 100644
--- a/radio/1.0/vts/functional/sap_hidl_hal_utils.h
+++ b/radio/1.0/vts/functional/sap_hidl_hal_utils.h
@@ -16,8 +16,6 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
-#include <VtsHalHidlTargetTestEnvBase.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -25,6 +23,7 @@
#include <android/hardware/radio/1.0/ISap.h>
#include <android/hardware/radio/1.0/ISapCallback.h>
#include <android/hardware/radio/1.0/types.h>
+#include <gtest/gtest.h>
#include "vts_test_util.h"
@@ -80,23 +79,9 @@
Return<void> transferProtocolResponse(int32_t token, SapResultCode resultCode);
};
-// Test environment for Sap HIDL HAL.
-class SapHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
- public:
- // get the test environment singleton
- static SapHidlEnvironment* Instance() {
- static SapHidlEnvironment* instance = new SapHidlEnvironment;
- return instance;
- }
- virtual void registerTestServices() override { registerTestService<ISap>(); }
-
- private:
- SapHidlEnvironment() {}
-};
-
// The main test class for Sap HIDL.
-class SapHidlTest : public ::testing::VtsHalHidlTargetTestBase {
- private:
+class SapHidlTest : public ::testing::TestWithParam<std::string> {
+ private:
std::mutex mtx;
std::condition_variable cv;
int count;
diff --git a/radio/1.0/vts/functional/vts_hal_radio_target_test.xml b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml
new file mode 100644
index 0000000..5e4a1cd
--- /dev/null
+++ b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs VtsHalRadioV1_0TargetTest.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+
+ <target_preparer class="com.android.tradefed.targetprep.MultiSimPreparer" />
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+ </target_preparer>
+
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="VtsHalRadioV1_0TargetTest->/data/local/tmp/VtsHalRadioV1_0TargetTest" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="VtsHalRadioV1_0TargetTest" />
+ </test>
+</configuration>
diff --git a/radio/1.0/vts/functional/vts_hal_sap_target_test.xml b/radio/1.0/vts/functional/vts_hal_sap_target_test.xml
new file mode 100644
index 0000000..457d700
--- /dev/null
+++ b/radio/1.0/vts/functional/vts_hal_sap_target_test.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs VtsHalSapV1_0TargetTest.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+
+ <target_preparer class="com.android.tradefed.targetprep.MultiSimPreparer" />
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
+ </target_preparer>
+
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="VtsHalSapV1_0TargetTest->/data/local/tmp/VtsHalSapV1_0TargetTest" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="VtsHalSapV1_0TargetTest" />
+ </test>
+</configuration>
diff --git a/radio/1.0/vts/functional/vts_test_util.h b/radio/1.0/vts/functional/vts_test_util.h
index 826f0de..05b47c9 100644
--- a/radio/1.0/vts/functional/vts_test_util.h
+++ b/radio/1.0/vts/functional/vts_test_util.h
@@ -16,9 +16,8 @@
#include <android-base/logging.h>
-#include <VtsHalHidlTargetTestBase.h>
-
#include <android/hardware/radio/1.0/types.h>
+#include <gtest/gtest.h>
using ::android::hardware::radio::V1_0::RadioError;
using ::android::hardware::radio::V1_0::SapResultCode;