diff options
author | Zhijun He <zhijunhe@google.com> | 2013-09-24 19:29:53 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-24 19:29:53 -0700 |
commit | 69716f4b1ddc1eb35ac5ef5a528139ed7d20d024 (patch) | |
tree | 3a0b4e225b4217f645e53a406ebed5fb90cf9c5d /tests | |
parent | 8c81382d688e617008d2721b0268a17b369a4c1c (diff) | |
parent | 3bf3b45f2d5eb43b74e1a46ff03ed3e2142b1b38 (diff) | |
download | hardware_libhardware-69716f4b1ddc1eb35ac5ef5a528139ed7d20d024.zip hardware_libhardware-69716f4b1ddc1eb35ac5ef5a528139ed7d20d024.tar.gz hardware_libhardware-69716f4b1ddc1eb35ac5ef5a528139ed7d20d024.tar.bz2 |
am 3bf3b45f: Camera2 Test: skip some tests for limited hardware level
* commit '3bf3b45f2d5eb43b74e1a46ff03ed3e2142b1b38':
Camera2 Test: skip some tests for limited hardware level
Diffstat (limited to 'tests')
-rw-r--r-- | tests/camera2/CameraBurstTests.cpp | 21 | ||||
-rw-r--r-- | tests/camera2/CameraMultiStreamTests.cpp | 17 |
2 files changed, 37 insertions, 1 deletions
diff --git a/tests/camera2/CameraBurstTests.cpp b/tests/camera2/CameraBurstTests.cpp index 47fcb3e..7301fce 100644 --- a/tests/camera2/CameraBurstTests.cpp +++ b/tests/camera2/CameraBurstTests.cpp @@ -362,6 +362,23 @@ TEST_F(CameraBurstTest, VariableBurst) { } } + camera_metadata_ro_entry hardwareLevel = + GetStaticEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL); + ASSERT_EQ(1u, hardwareLevel.count); + uint8_t level = hardwareLevel.data.u8[0]; + ASSERT_GE(level, ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED); + ASSERT_LE(level, ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL); + if (level == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED) { + 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 hardware supported level is limited " + << std::endl; + return; + } + dout << "Stream size is " << mWidth << " x " << mHeight << std::endl; dout << "Valid exposure range is: " << minExp << " - " << maxExp << " ns " << std::endl; @@ -373,7 +390,9 @@ TEST_F(CameraBurstTest, VariableBurst) { "Falling back to default set."; int32_t minSensitivity = 100; int32_t maxSensitivity = 800; - if (sensivityRange.count >= 2) { + if (sensivityRange.count == 2) { + ASSERT_GT(sensivityRange.data.i32[0], 0); + ASSERT_GT(sensivityRange.data.i32[1], 0); minSensitivity = sensivityRange.data.i32[0]; maxSensitivity = sensivityRange.data.i32[1]; } diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp index 9e26066..de1cfd6 100644 --- a/tests/camera2/CameraMultiStreamTests.cpp +++ b/tests/camera2/CameraMultiStreamTests.cpp @@ -477,6 +477,23 @@ TEST_F(CameraMultiStreamTest, MultiBurst) { ASSERT_EQ(0u, availableJpegSizes.count % 2); ASSERT_GE(availableJpegSizes.count, 2u); + camera_metadata_ro_entry hardwareLevel = + GetStaticEntry(ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL); + ASSERT_EQ(1u, hardwareLevel.count); + uint8_t level = hardwareLevel.data.u8[0]; + ASSERT_GE(level, ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED); + ASSERT_LE(level, ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_FULL); + if (level == ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED) { + 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 hardware supported level is limited " + << std::endl; + return; + } + // Find the right sizes for preview, metering, and capture streams // assumes at least 2 entries in availableProcessedSizes. int64_t minFrameDuration = DEFAULT_FRAME_DURATION; |