Loading contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #define LOG_TAG "contexthub_hidl_hal_test" #include <VtsHalHidlTargetTestBase.h> #include <VtsHalHidlTargetTestEnvBase.h> #include <android-base/logging.h> #include <android/hardware/contexthub/1.0/IContexthub.h> #include <android/hardware/contexthub/1.0/IContexthubCallback.h> Loading Loading @@ -92,12 +93,27 @@ std::vector<uint32_t> getHubIds() { return hubIds; } // Test environment for Contexthub HIDL HAL. class ContexthubHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { public: // get the test environment singleton static ContexthubHidlEnvironment* Instance() { static ContexthubHidlEnvironment* instance = new ContexthubHidlEnvironment; return instance; } virtual void registerTestServices() override { registerTestService<IContexthub>(); } private: ContexthubHidlEnvironment() {} }; // Base test fixture that initializes the HAL and makes the context hub API // handle available class ContexthubHidlTestBase : public ::testing::VtsHalHidlTargetTestBase { public: virtual void SetUp() override { hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>(); hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>( ContexthubHidlEnvironment::Instance()->getServiceName<IContexthub>()); ASSERT_NE(hubApi, nullptr); // getHubs() must be called at least once for proper initialization of the Loading Loading @@ -381,7 +397,11 @@ INSTANTIATE_TEST_CASE_P(HubIdSpecificTests, ContexthubTxnTest, } // anonymous namespace int main(int argc, char **argv) { ::testing::AddGlobalTestEnvironment(ContexthubHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); ContexthubHidlEnvironment::Instance()->init(&argc, argv); int status = RUN_ALL_TESTS(); ALOGI ("Test result = %d", status); return status; } Loading
contexthub/1.0/vts/functional/VtsHalContexthubV1_0TargetTest.cpp +22 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #define LOG_TAG "contexthub_hidl_hal_test" #include <VtsHalHidlTargetTestBase.h> #include <VtsHalHidlTargetTestEnvBase.h> #include <android-base/logging.h> #include <android/hardware/contexthub/1.0/IContexthub.h> #include <android/hardware/contexthub/1.0/IContexthubCallback.h> Loading Loading @@ -92,12 +93,27 @@ std::vector<uint32_t> getHubIds() { return hubIds; } // Test environment for Contexthub HIDL HAL. class ContexthubHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase { public: // get the test environment singleton static ContexthubHidlEnvironment* Instance() { static ContexthubHidlEnvironment* instance = new ContexthubHidlEnvironment; return instance; } virtual void registerTestServices() override { registerTestService<IContexthub>(); } private: ContexthubHidlEnvironment() {} }; // Base test fixture that initializes the HAL and makes the context hub API // handle available class ContexthubHidlTestBase : public ::testing::VtsHalHidlTargetTestBase { public: virtual void SetUp() override { hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>(); hubApi = ::testing::VtsHalHidlTargetTestBase::getService<IContexthub>( ContexthubHidlEnvironment::Instance()->getServiceName<IContexthub>()); ASSERT_NE(hubApi, nullptr); // getHubs() must be called at least once for proper initialization of the Loading Loading @@ -381,7 +397,11 @@ INSTANTIATE_TEST_CASE_P(HubIdSpecificTests, ContexthubTxnTest, } // anonymous namespace int main(int argc, char **argv) { ::testing::AddGlobalTestEnvironment(ContexthubHidlEnvironment::Instance()); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); ContexthubHidlEnvironment::Instance()->init(&argc, argv); int status = RUN_ALL_TESTS(); ALOGI ("Test result = %d", status); return status; }