diff options
author | Steven Moreland <smoreland@google.com> | 2017-03-08 19:31:39 -0800 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2017-03-08 19:31:52 -0800 |
commit | c615951317e4951ebf4fc48d2e9adb9686faf8e1 (patch) | |
tree | 38727fc8aa819f335c0b8ac84f2221cf8958a2fd /sensors | |
parent | d0c5b56e294f270d1e99fd7390b97fc4b1c5ea41 (diff) | |
download | platform_hardware_interfaces-c615951317e4951ebf4fc48d2e9adb9686faf8e1.tar.gz platform_hardware_interfaces-c615951317e4951ebf4fc48d2e9adb9686faf8e1.tar.bz2 platform_hardware_interfaces-c615951317e4951ebf4fc48d2e9adb9686faf8e1.zip |
Sensors: fix warnings in VTS test.
Test: pass
Change-Id: I514ef2750a96e356d7b100a6e132a65c2b157d84
Diffstat (limited to 'sensors')
-rw-r--r-- | sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp index b1483e3c66..2937a43549 100644 --- a/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp +++ b/sensors/1.0/vts/functional/VtsHalSensorsV1_0TargetTest.cpp @@ -213,7 +213,7 @@ std::vector<Event> SensorsTestSharedMemory::parseEvents(int64_t lastCounter, siz int32_t type = *reinterpret_cast<int32_t *>(mBuffer + offset + kOffsetType); int64_t timestamp = *reinterpret_cast<int64_t *>(mBuffer + offset + kOffsetTimestamp); - ALOGV("offset = %zu, cnt %" PRId32 ", token %" PRId32 ", type %" PRId32 ", timestamp %" PRId64, + ALOGV("offset = %zu, cnt %" PRId64 ", token %" PRId32 ", type %" PRId32 ", timestamp %" PRId64, offset, atomicCounter, token, type, timestamp); Event event = { @@ -688,7 +688,7 @@ TEST_F(SensorsHidlTest, NormalAccelerometerStreamingOperation) { ALOGI("Collected %zu samples", events.size()); - ASSERT_GT(events.size(), 0); + ASSERT_GT(events.size(), 0u); size_t nRealEvent = 0; for (auto & e : events) { @@ -773,7 +773,6 @@ TEST_F(SensorsHidlTest, AccelerometerSamplingPeriodHotSwitchOperation) { std::vector<Event> events1, events2; constexpr int64_t batchingPeriodInNs = 0; // no batching - constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s constexpr size_t minNEvent = 50; constexpr SensorType type = SensorType::ACCELEROMETER; @@ -826,7 +825,7 @@ TEST_F(SensorsHidlTest, AccelerometerSamplingPeriodHotSwitchOperation) { ++ nEvent; } } - ASSERT_GT(nEvent, 2); + ASSERT_GT(nEvent, 2u); minDelayAverageInterval = timestampInterval / (nEvent - 1); nEvent = 0; @@ -842,7 +841,7 @@ TEST_F(SensorsHidlTest, AccelerometerSamplingPeriodHotSwitchOperation) { ++ nEvent; } } - ASSERT_GT(nEvent, 2); + ASSERT_GT(nEvent, 2u); maxDelayAverageInterval = timestampInterval / (nEvent - 1); // change of rate is significant. @@ -859,8 +858,6 @@ TEST_F(SensorsHidlTest, AccelerometerBatchingOperation) { std::vector<Event> events; constexpr int64_t oneSecondInNs = 1ull * 1000 * 1000 * 1000; - constexpr useconds_t minTimeUs = 5*1000*1000; // 5 s - constexpr size_t minNEvent = 50; constexpr SensorType type = SensorType::ACCELEROMETER; constexpr int64_t maxBatchingTestTimeNs = 30ull * 1000 * 1000 * 1000; @@ -974,7 +971,7 @@ TEST_F(SensorsHidlTest, GyroscopeAshmemDirectReport) { auto events = mem->parseEvents(); // allowed to be 55% of nominal freq (50Hz) - ASSERT_GT(events.size(), 50 / 2); + ASSERT_GT(events.size(), 50u / 2u); ASSERT_LT(events.size(), static_cast<size_t>(110*1.5)); int64_t lastTimestamp = 0; |