Loading audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ #include <string> #include <vector> #include <fcntl.h> #include <unistd.h> #include <VtsHalHidlTargetTestBase.h> #include <android-base/logging.h> Loading Loading @@ -473,19 +476,19 @@ TEST_F(AudioPrimaryHidlTest, getParameters) { template <class DebugDump> static void testDebugDump(DebugDump debugDump) { // Dump in a temporary file // Note that SELinux must be deactivate for this test to work FILE* file = tmpfile(); ASSERT_NE(nullptr, file) << errno; // File descriptors to our pipe. fds[0] corresponds to the read end and // fds[1] to the write end. int fds[2]; ASSERT_EQ(0, pipe2(fds, O_NONBLOCK)) << errno; // Wrap the temporary file file descriptor in a native handle auto* nativeHandle = native_handle_create(1, 0); ASSERT_NE(nullptr, nativeHandle); nativeHandle->data[0] = fileno(file); nativeHandle->data[0] = fds[1]; // Wrap this native handle in a hidl handle hidl_handle handle; handle.setTo(nativeHandle, true /*take ownership*/); handle.setTo(nativeHandle, false /*take ownership*/); ASSERT_OK(debugDump(handle)); Loading @@ -493,12 +496,12 @@ static void testDebugDump(DebugDump debugDump) { // TODO: debugDump does not return a Result. // This mean that the hal can not report that it not implementing the // function. rewind(file); // can not fail char buff; if (fread(&buff, sizeof(buff), 1, file) != 1) { if (read(fds[0], &buff, 1) != 1) { doc::note("debugDump does not seem implemented"); } EXPECT_EQ(0, fclose(file)) << errno; EXPECT_EQ(0, close(fds[0])) << errno; EXPECT_EQ(0, close(fds[1])) << errno; } TEST_F(AudioPrimaryHidlTest, DebugDump) { Loading biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ namespace { static const uint32_t kTimeout = 3; static const std::chrono::seconds kTimeoutInSeconds = std::chrono::seconds(kTimeout); static const uint32_t kGroupId = 99; static const std::string kTmpDir = "/data/system/"; static const std::string kTmpDir = "/data/system/users/0/fpdata/"; static const uint32_t kIterations = 1000; // Wait for a callback to occur (signaled by the given future) up to the Loading Loading @@ -186,7 +186,7 @@ class FingerprintHidlTest : public ::testing::VtsHalHidlTargetTestBase { ASSERT_FALSE(mService == nullptr); // Create an active group // FP service can only write to /data/system due to // FP service can only write to /data/system/users/*/fpdata/ due to // SELinux Policy and Linux Dir Permissions Return<RequestStatus> res = mService->setActiveGroup(kGroupId, kTmpDir); ASSERT_EQ(RequestStatus::SYS_OK, static_cast<RequestStatus>(res)); Loading tests/bar/1.0/default/Android.bp +7 −2 Original line number Diff line number Diff line cc_library_shared { cc_library { name: "android.hardware.tests.bar@1.0-impl", defaults: ["hidl_defaults"], relative_install_path: "hw", Loading @@ -14,10 +14,15 @@ cc_library_shared { "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "liblog", "libutils", ], // These are static libs only for testing purposes and portability. Shared // libs should be used on device. static_libs: [ "android.hardware.tests.foo@1.0", "android.hardware.tests.bar@1.0", ], } tests/baz/1.0/IBaz.hal +0 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,6 @@ interface IBaz extends IBase { bitfield<BitField> bf; }; @Fragile @NoReally(very="yes", array={"a","b","c"}) oneway doThis(float param); doThatAndReturnSomething(int64_t param) generates (int32_t result); Loading tests/baz/1.0/default/Android.bp +8 −2 Original line number Diff line number Diff line cc_library_shared { cc_library { name: "android.hardware.tests.baz@1.0-impl", defaults: ["hidl_defaults"], relative_install_path: "hw", Loading @@ -7,9 +7,15 @@ cc_library_shared { ], shared_libs: [ "libbase", "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "liblog", "libutils", "android.hardware.tests.baz@1.0", ], // These are static libs only for testing purposes and portability. Shared // libs should be used on device. static_libs: ["android.hardware.tests.baz@1.0"], } Loading
audio/2.0/vts/functional/AudioPrimaryHidlHalTest.cpp +12 −9 Original line number Diff line number Diff line Loading @@ -24,6 +24,9 @@ #include <string> #include <vector> #include <fcntl.h> #include <unistd.h> #include <VtsHalHidlTargetTestBase.h> #include <android-base/logging.h> Loading Loading @@ -473,19 +476,19 @@ TEST_F(AudioPrimaryHidlTest, getParameters) { template <class DebugDump> static void testDebugDump(DebugDump debugDump) { // Dump in a temporary file // Note that SELinux must be deactivate for this test to work FILE* file = tmpfile(); ASSERT_NE(nullptr, file) << errno; // File descriptors to our pipe. fds[0] corresponds to the read end and // fds[1] to the write end. int fds[2]; ASSERT_EQ(0, pipe2(fds, O_NONBLOCK)) << errno; // Wrap the temporary file file descriptor in a native handle auto* nativeHandle = native_handle_create(1, 0); ASSERT_NE(nullptr, nativeHandle); nativeHandle->data[0] = fileno(file); nativeHandle->data[0] = fds[1]; // Wrap this native handle in a hidl handle hidl_handle handle; handle.setTo(nativeHandle, true /*take ownership*/); handle.setTo(nativeHandle, false /*take ownership*/); ASSERT_OK(debugDump(handle)); Loading @@ -493,12 +496,12 @@ static void testDebugDump(DebugDump debugDump) { // TODO: debugDump does not return a Result. // This mean that the hal can not report that it not implementing the // function. rewind(file); // can not fail char buff; if (fread(&buff, sizeof(buff), 1, file) != 1) { if (read(fds[0], &buff, 1) != 1) { doc::note("debugDump does not seem implemented"); } EXPECT_EQ(0, fclose(file)) << errno; EXPECT_EQ(0, close(fds[0])) << errno; EXPECT_EQ(0, close(fds[1])) << errno; } TEST_F(AudioPrimaryHidlTest, DebugDump) { Loading
biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ namespace { static const uint32_t kTimeout = 3; static const std::chrono::seconds kTimeoutInSeconds = std::chrono::seconds(kTimeout); static const uint32_t kGroupId = 99; static const std::string kTmpDir = "/data/system/"; static const std::string kTmpDir = "/data/system/users/0/fpdata/"; static const uint32_t kIterations = 1000; // Wait for a callback to occur (signaled by the given future) up to the Loading Loading @@ -186,7 +186,7 @@ class FingerprintHidlTest : public ::testing::VtsHalHidlTargetTestBase { ASSERT_FALSE(mService == nullptr); // Create an active group // FP service can only write to /data/system due to // FP service can only write to /data/system/users/*/fpdata/ due to // SELinux Policy and Linux Dir Permissions Return<RequestStatus> res = mService->setActiveGroup(kGroupId, kTmpDir); ASSERT_EQ(RequestStatus::SYS_OK, static_cast<RequestStatus>(res)); Loading
tests/bar/1.0/default/Android.bp +7 −2 Original line number Diff line number Diff line cc_library_shared { cc_library { name: "android.hardware.tests.bar@1.0-impl", defaults: ["hidl_defaults"], relative_install_path: "hw", Loading @@ -14,10 +14,15 @@ cc_library_shared { "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "liblog", "libutils", ], // These are static libs only for testing purposes and portability. Shared // libs should be used on device. static_libs: [ "android.hardware.tests.foo@1.0", "android.hardware.tests.bar@1.0", ], }
tests/baz/1.0/IBaz.hal +0 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,6 @@ interface IBaz extends IBase { bitfield<BitField> bf; }; @Fragile @NoReally(very="yes", array={"a","b","c"}) oneway doThis(float param); doThatAndReturnSomething(int64_t param) generates (int32_t result); Loading
tests/baz/1.0/default/Android.bp +8 −2 Original line number Diff line number Diff line cc_library_shared { cc_library { name: "android.hardware.tests.baz@1.0-impl", defaults: ["hidl_defaults"], relative_install_path: "hw", Loading @@ -7,9 +7,15 @@ cc_library_shared { ], shared_libs: [ "libbase", "libcutils", "libhidlbase", "libhidltransport", "libhwbinder", "liblog", "libutils", "android.hardware.tests.baz@1.0", ], // These are static libs only for testing purposes and portability. Shared // libs should be used on device. static_libs: ["android.hardware.tests.baz@1.0"], }