change all vts hidl tests to use VtsHalHidlTargetBaseTest

Bug: 33385836
Test: mma
Change-Id: I660d6e0fce6422d87d4b227273a77c95d20ed3f2
This commit is contained in:
Yuexi Ma
2017-02-24 13:17:02 -08:00
parent 6ca34f1bf5
commit 178dfd5e29
27 changed files with 43 additions and 48 deletions

View File

@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalBluetoothV1_0TargetTest",
gtest: true,
srcs: ["VtsHalBluetoothV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -28,7 +27,7 @@ cc_test {
"libutils",
"android.hardware.bluetooth@1.0",
],
static_libs: ["libgtest"],
static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",

View File

@@ -23,7 +23,7 @@
#include <hardware/bluetooth.h>
#include <utils/Log.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include <condition_variable>
#include <mutex>
#include <queue>
@@ -117,11 +117,11 @@ class ThroughputLogger {
};
// The main test class for Bluetooth HIDL HAL.
class BluetoothHidlTest : public ::testing::Test {
class BluetoothHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
// currently test passthrough mode only
bluetooth = IBluetoothHci::getService();
bluetooth = testing::VtsHalHidlTargetBaseTest::getService<IBluetoothHci>();
ASSERT_NE(bluetooth, nullptr);
ALOGI("%s: getService() for bluetooth is %s", __func__,
bluetooth->isRemote() ? "remote" : "local");

View File

@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalIrV1_0TargetTest",
gtest: true,
srcs: ["VtsHalIrV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -27,7 +26,7 @@ cc_test {
"libutils",
"android.hardware.ir@1.0",
],
static_libs: ["libgtest"],
static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",

View File

@@ -21,7 +21,7 @@
#include <android/hardware/ir/1.0/IConsumerIr.h>
#include <android/hardware/ir/1.0/types.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include <algorithm>
using ::android::hardware::ir::V1_0::IConsumerIr;
@@ -31,10 +31,10 @@ using ::android::hardware::Return;
using ::android::sp;
// The main test class for IR HIDL HAL.
class ConsumerIrHidlTest : public ::testing::Test {
class ConsumerIrHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
ir = IConsumerIr::getService();
ir = testing::VtsHalHidlTargetBaseTest::getService<IConsumerIr>();
ASSERT_NE(ir, nullptr);
}

View File

@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalNfcV1_0TargetTest",
gtest: true,
srcs: ["VtsHalNfcV1_0TargetTest.cpp"],
shared_libs: [
"libbase",
@@ -28,7 +27,7 @@ cc_test {
"libutils",
"android.hardware.nfc@1.0",
],
static_libs: ["libgtest"],
static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",

View File

@@ -22,7 +22,7 @@
#include <android/hardware/nfc/1.0/types.h>
#include <hardware/nfc.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -56,10 +56,10 @@ using ::android::sp;
#define TIMEOUT_PERIOD 5
// The main test class for NFC HIDL HAL.
class NfcHidlTest : public ::testing::Test {
class NfcHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
nfc_ = INfc::getService();
nfc_ = testing::VtsHalHidlTargetBaseTest::getService<INfc>();
ASSERT_NE(nfc_, nullptr);
nfc_cb_ = new NfcClientCallback(*this);

View File

@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalRadioV1_0TargetTest",
gtest: true,
srcs: ["radio_hidl_hal_test.cpp",
"radio_response.cpp",
"radio_hidl_hal_icc.cpp",
@@ -31,7 +30,7 @@ cc_test {
"libutils",
"android.hardware.radio@1.0",
],
static_libs: ["libgtest"],
static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",

View File

@@ -17,7 +17,7 @@
#include<radio_hidl_hal_utils.h>
void RadioHidlTest::SetUp() {
radio = IRadio::getService(hidl_string("rild"));
radio = testing::VtsHalHidlTargetBaseTest::getService<IRadio>(hidl_string("rild"));
ASSERT_NE(radio, nullptr);
radioRsp = new RadioResponse(*this);

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include <chrono>
#include <condition_variable>
#include <mutex>
@@ -423,7 +423,7 @@ public:
};
// The main test class for Radio HIDL.
class RadioHidlTest : public ::testing::Test {
class RadioHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
private:
std::mutex mtx;
std::condition_variable cv;

View File

@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalWifiV1_0TargetTest",
gtest: true,
srcs: [
"VtsHalWifiV1_0TargetTest.cpp",
"wifi_ap_iface_hidl_test.cpp",
@@ -38,7 +37,7 @@ cc_test {
"libutils",
"android.hardware.wifi@1.0",
],
static_libs: ["libgtest"],
static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiApIface.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all AP Iface HIDL interface tests.
*/
class WifiApIfaceHidlTest : public ::testing::Test {
class WifiApIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiChip.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all Wifi chip HIDL interface tests.
*/
class WifiChipHidlTest : public ::testing::Test {
class WifiChipHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -21,7 +21,7 @@
#include <type_traits>
#include <utility>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
namespace {
namespace detail {

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifi.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all root Wifi HIDL interface tests.
*/
class WifiHidlTest : public ::testing::Test {
class WifiHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_call_util.h"
#include "wifi_hidl_test_utils.h"
@@ -43,7 +43,7 @@ void stopFramework() {
void startFramework() { ASSERT_EQ(std::system("svc wifi enable"), 0); }
sp<IWifi> getWifi() {
sp<IWifi> wifi = IWifi::getService();
sp<IWifi> wifi = testing::VtsHalHidlTargetBaseTest::getService<IWifi>();
return wifi;
}

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiNanIface.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all NAN Iface HIDL interface tests.
*/
class WifiNanIfaceHidlTest : public ::testing::Test {
class WifiNanIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiP2pIface.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all P2P Iface HIDL interface tests.
*/
class WifiP2pIfaceHidlTest : public ::testing::Test {
class WifiP2pIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiRttController.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all RTT controller HIDL interface tests.
*/
class WifiRttControllerHidlTest : public ::testing::Test {
class WifiRttControllerHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -18,7 +18,7 @@
#include <android/hardware/wifi/1.0/IWifiStaIface.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "wifi_hidl_test_utils.h"
@@ -28,7 +28,7 @@ using ::android::sp;
/**
* Fixture to use for all STA Iface HIDL interface tests.
*/
class WifiStaIfaceHidlTest : public ::testing::Test {
class WifiStaIfaceHidlTest : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {}

View File

@@ -37,6 +37,6 @@ LOCAL_SHARED_LIBRARIES := \
libwifi-system
LOCAL_STATIC_LIBRARIES := \
libgmock \
libgtest
VtsHalHidlTargetBaseTest
include $(BUILD_NATIVE_TEST)

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"

View File

@@ -15,7 +15,7 @@
*/
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include <hidl/HidlTransportSupport.h>
#include <android/hidl/manager/1.0/IServiceManager.h>
@@ -174,7 +174,7 @@ void startSupplicantAndWaitForHidlService() {
}
sp<ISupplicant> getSupplicant() {
return ISupplicant::getService(kSupplicantServiceName);
return getService<ISupplicant>(kSupplicantServiceName);
}
sp<ISupplicantStaIface> getSupplicantStaIface() {

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"

View File

@@ -16,7 +16,7 @@
#include <android-base/logging.h>
#include <gtest/gtest.h>
#include <VtsHalHidlTargetBaseTest.h>
#include "supplicant_hidl_test_utils.h"