summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2014-12-12 22:16:55 +0100
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2014-12-12 22:16:55 +0100
commit1f1d79732fa50d140eb50c7fb756e116e3da713d (patch)
treea33072c9b2c342cbb587dde0a50e666e8f00a5cd /tests
parent719b8423102e469b5a537321f02011415b376dbe (diff)
downloadhardware_libhardware-1f1d79732fa50d140eb50c7fb756e116e3da713d.zip
hardware_libhardware-1f1d79732fa50d140eb50c7fb756e116e3da713d.tar.gz
hardware_libhardware-1f1d79732fa50d140eb50c7fb756e116e3da713d.tar.bz2
Fix build in C++11 mode
Fix build in C++11 mode instead of reverting to C++98 mode. (Fixes some constructs that were mistaken for C++11 literals and a use of the std::ostream(NULL) constructor). Building in C++98 mode causes clang to fall over conflicting definitions of char16_t. Change-Id: I66230eeb960f4a894d6c98fe7935ec932569c5a4 Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/camera2/Android.mk1
-rw-r--r--tests/camera2/CameraBurstTests.cpp8
-rw-r--r--tests/camera2/CameraMultiStreamTests.cpp6
3 files changed, 7 insertions, 8 deletions
diff --git a/tests/camera2/Android.mk b/tests/camera2/Android.mk
index 41b3a40..1128522 100644
--- a/tests/camera2/Android.mk
+++ b/tests/camera2/Android.mk
@@ -35,7 +35,6 @@ LOCAL_C_INCLUDES += \
frameworks/native/include \
LOCAL_CFLAGS += -Wall -Wextra
-LOCAL_CPPFLAGS := -std=gnu++98
LOCAL_MODULE:= camera2_test
LOCAL_MODULE_STEM_32 := camera2_test
LOCAL_MODULE_STEM_64 := camera2_test64
diff --git a/tests/camera2/CameraBurstTests.cpp b/tests/camera2/CameraBurstTests.cpp
index 58763de..560fca5 100644
--- a/tests/camera2/CameraBurstTests.cpp
+++ b/tests/camera2/CameraBurstTests.cpp
@@ -49,7 +49,7 @@
#define dout if (0) std::cout
#endif
-#define WARN_UNLESS(condition) (!(condition) ? (std::cerr) : (std::ostream(NULL)) << "Warning: ")
+#define WARN_UNLESS(condition) if(!(condition)) std::cerr << "Warning: "
#define WARN_LE(exp, act) WARN_UNLESS((exp) <= (act))
#define WARN_LT(exp, act) WARN_UNLESS((exp) < (act))
#define WARN_GT(exp, act) WARN_UNLESS((exp) > (act))
@@ -219,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 %"PRId64, i,
+ ALOGV("Submitting capture request %d with exposure %" PRId64, i,
exposures[i]);
dout << "Capture request " << i << " exposure is "
<< (exposures[i]/1e6f) << std::endl;
@@ -231,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 %"PRId64, 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;
@@ -615,7 +615,7 @@ TEST_F(CameraBurstTest, DISABLED_VariableBurst) {
&durationList[i], 1));
ASSERT_EQ(OK, tmpRequest.update(ANDROID_SENSOR_SENSITIVITY,
&sensitivityList[i], 1));
- ALOGV("Submitting capture %zu with exposure %"PRId64", frame duration %"PRId64", 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" <<
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp
index 2742466..89af91d 100644
--- a/tests/camera2/CameraMultiStreamTests.cpp
+++ b/tests/camera2/CameraMultiStreamTests.cpp
@@ -356,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 %"PRId64", 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);
@@ -529,7 +529,7 @@ TEST_F(CameraMultiStreamTest, DISABLED_MultiBurst) {
minFrameDuration = DEFAULT_FRAME_DURATION;
}
- ALOGV("targeted minimal frame duration is: %"PRId64"ns", minFrameDuration);
+ ALOGV("targeted minimal frame duration is: %" PRId64 "ns", minFrameDuration);
data = &(availableJpegSizes.data.i32[0]);
count = availableJpegSizes.count;
@@ -649,7 +649,7 @@ TEST_F(CameraMultiStreamTest, DISABLED_MultiBurst) {
ASSERT_EQ(OK, previewRequest.update(
ANDROID_SENSOR_EXPOSURE_TIME,
&exposures[i], 1));
- ALOGV("Submitting preview request %zu with exposure %"PRId64,
+ ALOGV("Submitting preview request %zu with exposure %" PRId64,
i, exposures[i]);
ASSERT_EQ(OK, mDevice->setStreamingRequest(previewRequest));