From 0ab4c96ab8889127955971bbf5c157b7191cd1ea Mon Sep 17 00:00:00 2001 From: Sasha Levitskiy Date: Mon, 21 Apr 2014 14:49:12 -0700 Subject: Camera2: Tests: 64-bit warning fixit Change-Id: Idb761d2bfd8f07838a194f986f7c0a06429f4049 Signed-off-by: Sasha Levitskiy --- tests/camera2/CameraBurstTests.cpp | 17 +++++++++-------- tests/camera2/CameraMultiStreamTests.cpp | 13 +++++++------ 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/camera2/CameraBurstTests.cpp b/tests/camera2/CameraBurstTests.cpp index 51a6b0e..65ff460 100644 --- a/tests/camera2/CameraBurstTests.cpp +++ b/tests/camera2/CameraBurstTests.cpp @@ -15,6 +15,7 @@ */ #include +#include #define LOG_TAG "CameraBurstTest" //#define LOG_NDEBUG 0 @@ -218,7 +219,7 @@ TEST_F(CameraBurstTest, ManualExposureControl) { CameraMetadata tmpRequest = previewRequest; ASSERT_EQ(OK, tmpRequest.update(ANDROID_SENSOR_EXPOSURE_TIME, &exposures[i], 1)); - ALOGV("Submitting capture request %d with exposure %lld", i, + ALOGV("Submitting capture request %d with exposure %"PRId64, i, exposures[i]); dout << "Capture request " << i << " exposure is " << (exposures[i]/1e6f) << std::endl; @@ -230,7 +231,7 @@ TEST_F(CameraBurstTest, ManualExposureControl) { float brightnesses[CAMERA_FRAME_BURST_COUNT]; // Get each frame (metadata) and then the buffer. Calculate brightness. for (int i = 0; i < CAMERA_FRAME_BURST_COUNT; ++i) { - ALOGV("Reading capture request %d with exposure %lld", i, exposures[i]); + ALOGV("Reading capture request %d with exposure %"PRId64, i, exposures[i]); ASSERT_EQ(OK, mDevice->waitForNextFrame(CAMERA_FRAME_TIMEOUT)); ALOGV("Reading capture request-1 %d", i); CaptureResult result; @@ -613,7 +614,7 @@ TEST_F(CameraBurstTest, VariableBurst) { &durationList[i], 1)); ASSERT_EQ(OK, tmpRequest.update(ANDROID_SENSOR_SENSITIVITY, &sensitivityList[i], 1)); - ALOGV("Submitting capture %d with exposure %lld, frame duration %lld, sensitivity %d", + ALOGV("Submitting capture %zu with exposure %"PRId64", frame duration %"PRId64", sensitivity %d", i, expList[i], durationList[i], sensitivityList[i]); dout << "Capture request " << i << ": exposure is " << (expList[i]/1e6f) << " ms" << @@ -631,7 +632,7 @@ TEST_F(CameraBurstTest, VariableBurst) { // Get each frame (metadata) and then the buffer. Calculate brightness. for (size_t i = 0; i < expList.size(); ++i) { - ALOGV("Reading request %d", i); + ALOGV("Reading request %zu", i); dout << "Waiting for capture " << i << ": " << " exposure " << (expList[i]/1e6f) << " ms," << " frame duration " << (durationList[i]/1e6f) << " ms," << @@ -644,10 +645,10 @@ TEST_F(CameraBurstTest, VariableBurst) { if (durationList[i] * 2 > waitLimit) waitLimit = durationList[i] * 2; ASSERT_EQ(OK, mDevice->waitForNextFrame(waitLimit)); - ALOGV("Reading capture request-1 %d", i); + ALOGV("Reading capture request-1 %zu", i); CaptureResult result; ASSERT_EQ(OK, mDevice->getNextResult(&result)); - ALOGV("Reading capture request-2 %d", i); + ALOGV("Reading capture request-2 %zu", i); ASSERT_EQ(OK, mFrameListener->waitForFrame(CAMERA_FRAME_TIMEOUT)); ALOGV("We got the frame now"); @@ -668,7 +669,7 @@ TEST_F(CameraBurstTest, VariableBurst) { avgBrightness = 255; } - ALOGV("Total brightness for frame %d was %lld (underexposed %d, " + ALOGV("Total brightness for frame %zu was %lld (underexposed %d, " "overexposed %d), avg %f", i, brightness, underexposed, overexposed, avgBrightness); dout << "Average brightness (frame " << i << ") was " << avgBrightness @@ -711,7 +712,7 @@ TEST_F(CameraBurstTest, VariableBurst) { if (dumpFrames) { String8 dumpName = - String8::format("/data/local/tmp/camera2_test_variable_burst_frame_%03d.yuv", i); + String8::format("/data/local/tmp/camera2_test_variable_burst_frame_%03zu.yuv", i); dout << " Writing YUV dump to " << dumpName << std::endl; DumpYuvToFile(dumpName, imgBuffer); } diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp index c7db679..536b656 100644 --- a/tests/camera2/CameraMultiStreamTests.cpp +++ b/tests/camera2/CameraMultiStreamTests.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #define LOG_TAG "CameraMultiStreamTest" //#define LOG_NDEBUG 0 #include "CameraStreamFixture.h" @@ -355,7 +356,7 @@ public: ASSERT_EQ(OK, request.update(ANDROID_SENSOR_EXPOSURE_TIME, &exposures[i], 1)); ASSERT_EQ(OK, request.update(ANDROID_SENSOR_SENSITIVITY, &sensitivities[i], 1)); ASSERT_EQ(OK, mDevice->capture(request)); - ALOGV("Submitting request with: id %d with exposure %lld, sensitivity %d", + ALOGV("Submitting request with: id %d with exposure %"PRId64", sensitivity %d", *requestIdStart, exposures[i], sensitivities[i]); if (CAMERA_MULTI_STREAM_DEBUGGING) { request.dump(STDOUT_FILENO); @@ -370,7 +371,7 @@ public: // Set wait limit based on expected frame duration. int64_t waitLimit = CAMERA_FRAME_TIMEOUT; for (size_t i = 0; i < requestCount; i++) { - ALOGV("Reading request result %d", i); + ALOGV("Reading request result %zu", i); /** * Raise the timeout to be at least twice as long as the exposure @@ -396,7 +397,7 @@ public: } } while (resultRequestId != targetRequestId); targetRequestId++; - ALOGV("Got capture burst result for request %d", i); + ALOGV("Got capture burst result for request %zu", i); // Validate capture result if (CAMERA_MULTI_STREAM_DEBUGGING) { @@ -415,7 +416,7 @@ public: captureBurstTimes.push_back(systemTime()); CpuConsumer::LockedBuffer imgBuffer; ASSERT_EQ(OK, consumer->lockNextBuffer(&imgBuffer)); - ALOGV("Got capture buffer for request %d", i); + ALOGV("Got capture buffer for request %zu", i); /** * TODO: Validate capture buffer. Current brightness calculation @@ -527,7 +528,7 @@ TEST_F(CameraMultiStreamTest, MultiBurst) { minFrameDuration = DEFAULT_FRAME_DURATION; } - ALOGV("targeted minimal frame duration is: %lldns", minFrameDuration); + ALOGV("targeted minimal frame duration is: %"PRId64"ns", minFrameDuration); data = &(availableJpegSizes.data.i32[0]); count = availableJpegSizes.count; @@ -647,7 +648,7 @@ TEST_F(CameraMultiStreamTest, MultiBurst) { ASSERT_EQ(OK, previewRequest.update( ANDROID_SENSOR_EXPOSURE_TIME, &exposures[i], 1)); - ALOGV("Submitting preview request %d with exposure %lld", + ALOGV("Submitting preview request %zu with exposure %"PRId64, i, exposures[i]); ASSERT_EQ(OK, mDevice->setStreamingRequest(previewRequest)); -- cgit v1.1