summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-10-28 15:52:56 -0700
committerZhijun He <zhijunhe@google.com>2013-10-28 15:52:56 -0700
commitb44ff6508bbcb8df751b5815dd4dfbd4cae252f7 (patch)
tree3ab82dd3f8caaefdfb235b26c8336fe7b9c1525b /tests
parentb0c303229fcbc89a0afa8f170de64f2a7fee9d6c (diff)
downloadhardware_libhardware-b44ff6508bbcb8df751b5815dd4dfbd4cae252f7.zip
hardware_libhardware-b44ff6508bbcb8df751b5815dd4dfbd4cae252f7.tar.gz
hardware_libhardware-b44ff6508bbcb8df751b5815dd4dfbd4cae252f7.tar.bz2
Camera2 Test: Skip CameraModuleTest for HAL V1 devices
Bug: 10971907 Change-Id: Ia3aa0e370d7eb5de6bb1fb7ff48a71ea5605fa17
Diffstat (limited to 'tests')
-rw-r--r--tests/camera2/CameraModuleTests.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/camera2/CameraModuleTests.cpp b/tests/camera2/CameraModuleTests.cpp
index ae4267b..828c56a 100644
--- a/tests/camera2/CameraModuleTests.cpp
+++ b/tests/camera2/CameraModuleTests.cpp
@@ -64,11 +64,22 @@ TEST_F(CameraModuleTest, LoadModule) {
TEST_EXTENSION_FORKING_INIT;
+ status_t stat;
for (int i = 0; i < mNumberOfCameras; ++i) {
- CreateCamera(i, &mDevice);
- ASSERT_EQ(OK, initializeDevice(i))
- << "Failed to initialize device " << i;
- mDevice.clear();
+ if (isDeviceVersionHal2(i, &stat) && stat == OK) {
+ CreateCamera(i, &mDevice);
+ ASSERT_EQ(OK, initializeDevice(i))
+ << "Failed to initialize device " << i;
+ mDevice.clear();
+ } else {
+ const ::testing::TestInfo* const test_info =
+ ::testing::UnitTest::GetInstance()->current_test_info();
+ std::cerr << "Skipping test "
+ << test_info->test_case_name() << "."
+ << test_info->name()
+ << " because HAL device version is V1"
+ << std::endl;
+ }
}
}