change all vts hidl tests to use VtsHalHidlTargetBaseTest (internal master)
Bug: 33385836
Test: mma
Change-Id: Ide3ebc4a9db76257f33bcfb0c1f13d2ee33eeaa8
diff --git a/contexthub/1.0/vts/functional/Android.bp b/contexthub/1.0/vts/functional/Android.bp
index c3c121c..8ef5f62 100644
--- a/contexthub/1.0/vts/functional/Android.bp
+++ b/contexthub/1.0/vts/functional/Android.bp
@@ -16,7 +16,6 @@
cc_test {
name: "VtsHalContexthubV1_0TargetTest",
- gtest: true,
srcs: ["VtsHalContexthubV1_0TargetTest.cpp"],
shared_libs: [
"liblog",
@@ -25,7 +24,7 @@
"libutils",
"android.hardware.contexthub@1.0",
],
- static_libs: ["libgtest"],
+ static_libs: ["VtsHalHidlTargetBaseTest"],
cflags: [
"-O0",
"-g",
diff --git a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
index e4dea4f..c5eea89 100644
--- a/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
+++ b/contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp
@@ -21,7 +21,7 @@
#include <android/hardware/contexthub/1.0/IContexthubCallback.h>
#include <android/hardware/contexthub/1.0/types.h>
#include <android/log.h>
-#include <gtest/gtest.h>
+#include <VtsHalHidlTargetBaseTest.h>
#include <cinttypes>
#include <future>
@@ -80,7 +80,7 @@
static std::vector<uint32_t> hubIds;
if (hubIds.size() == 0) {
- sp<IContexthub> hubApi = IContexthub::getService(CONTEXTHUB_SERVICE_NAME);
+ sp<IContexthub> hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>(CONTEXTHUB_SERVICE_NAME);
if (hubApi != nullptr) {
for (ContextHub hub : getHubsSync(hubApi)) {
@@ -95,10 +95,10 @@
// Base test fixture that initializes the HAL and makes the context hub API
// handle available
-class ContexthubHidlTestBase : public ::testing::Test {
+class ContexthubHidlTestBase : public ::testing::VtsHalHidlTargetBaseTest {
public:
virtual void SetUp() override {
- hubApi = IContexthub::getService(CONTEXTHUB_SERVICE_NAME);
+ hubApi = ::testing::VtsHalHidlTargetBaseTest::getService<IContexthub>(CONTEXTHUB_SERVICE_NAME);
ASSERT_NE(hubApi, nullptr);
// getHubs() must be called at least once for proper initialization of the