From a1bef2b9a66c92d6a1aae32c0b2d7c66fb5305ab Mon Sep 17 00:00:00 2001 From: Gaurav Batra Date: Fri, 28 Mar 2014 17:03:36 -0700 Subject: Camera2 Test: fix test criteria for exposure time Add some tolerance while testing requested exposure times against capture times. Change-Id: I609e7819cde8ee466e152775781a6542e6686ded --- tests/camera2/CameraMultiStreamTests.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests') 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]); } } } -- cgit v1.1