diff options
author | Gaurav Batra <gbatra@nvidia.com> | 2014-03-28 17:03:36 -0700 |
---|---|---|
committer | Gaurav Batra <gbatra@nvidia.com> | 2014-03-28 17:03:36 -0700 |
commit | a1bef2b9a66c92d6a1aae32c0b2d7c66fb5305ab (patch) | |
tree | 26e4880ad46878df36844519cfbdda977f8b5f69 /tests/camera2 | |
parent | 5106ad0c6e664a622d177d997d3ec7147ef1ae8f (diff) | |
download | hardware_libhardware-a1bef2b9a66c92d6a1aae32c0b2d7c66fb5305ab.zip hardware_libhardware-a1bef2b9a66c92d6a1aae32c0b2d7c66fb5305ab.tar.gz hardware_libhardware-a1bef2b9a66c92d6a1aae32c0b2d7c66fb5305ab.tar.bz2 |
Camera2 Test: fix test criteria for exposure time
Add some tolerance while testing requested exposure times against capture times.
Change-Id: I609e7819cde8ee466e152775781a6542e6686ded
Diffstat (limited to 'tests/camera2')
-rw-r--r-- | tests/camera2/CameraMultiStreamTests.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp index de1cfd6..a78950c 100644 --- a/tests/camera2/CameraMultiStreamTests.cpp +++ b/tests/camera2/CameraMultiStreamTests.cpp @@ -35,7 +35,10 @@ #define CAMERA_MULTI_STREAM_DEBUGGING 0 #define CAMERA_FRAME_TIMEOUT 1000000000LL // nsecs (1 secs) #define PREVIEW_RENDERING_TIME_INTERVAL 200000 // in unit of us, 200ms -#define TOLERANCE_MARGIN 0.01 // 1% tolerance margin for exposure sanity check. +// 1% tolerance margin for exposure sanity check against metadata +#define TOLERANCE_MARGIN_METADATA 0.01 +// 5% tolerance margin for exposure sanity check against capture times +#define TOLERANCE_MARGIN_CAPTURE 0.05 /* constants for display */ #define DISPLAY_BUFFER_HEIGHT 1024 #define DISPLAY_BUFFER_WIDTH 1024 @@ -399,10 +402,10 @@ public: // TODO: Need revisit it to figure out an accurate margin. int64_t resultExposure = GetExposureValue(frameMetadata); int32_t resultSensitivity = GetSensitivity(frameMetadata); - EXPECT_LE(sensitivities[i] * (1.0 - TOLERANCE_MARGIN), resultSensitivity); - EXPECT_GE(sensitivities[i] * (1.0 + TOLERANCE_MARGIN), resultSensitivity); - EXPECT_LE(exposures[i] * (1.0 - TOLERANCE_MARGIN), resultExposure); - EXPECT_GE(exposures[i] * (1.0 + TOLERANCE_MARGIN), resultExposure); + EXPECT_LE(sensitivities[i] * (1.0 - TOLERANCE_MARGIN_METADATA), resultSensitivity); + EXPECT_GE(sensitivities[i] * (1.0 + TOLERANCE_MARGIN_METADATA), resultSensitivity); + EXPECT_LE(exposures[i] * (1.0 - TOLERANCE_MARGIN_METADATA), resultExposure); + EXPECT_GE(exposures[i] * (1.0 + TOLERANCE_MARGIN_METADATA), resultExposure); ASSERT_EQ(OK, listener->waitForFrame(waitLimit)); captureBurstTimes.push_back(systemTime()); @@ -422,7 +425,7 @@ public: if (i > 0) { nsecs_t timeDelta = captureBurstTimes[i] - captureBurstTimes[i-1]; - EXPECT_GE(timeDelta, exposures[i]); + EXPECT_GE(timeDelta * ( 1 + TOLERANCE_MARGIN_CAPTURE), exposures[i]); } } } |