diff options
author | Chih-Hung Hsieh <chh@google.com> | 2017-12-05 11:13:32 -0800 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2017-12-05 11:13:32 -0800 |
commit | 4f3895ce61663a8de76bd69a574381b31c8bb28e (patch) | |
tree | b62f1427f352fb39b8f4d03c6a065affa1c864d1 /libs | |
parent | 5281f56377bebf9932b14cd7f6490117612acfc0 (diff) | |
download | native-4f3895ce61663a8de76bd69a574381b31c8bb28e.tar.gz |
Fix clang compiler warnings.
* Do not include <base/logging.h> to avoid redefinition warnings.
* Use unsigned 0U to avoid signed vs unsigned comparison.
* Fix typo of unused ret2.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I5554ffaadd54d967580998672e1dd64428269566
Diffstat (limited to 'libs')
-rw-r--r-- | libs/vr/libdvr/tests/dvr_named_buffer-test.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp b/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp index c21deb0d0e..5c837e74ea 100644 --- a/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp +++ b/libs/vr/libdvr/tests/dvr_named_buffer-test.cpp @@ -5,7 +5,6 @@ #include <dvr/dvr_surface.h> #include <system/graphics.h> -#include <base/logging.h> #include <gtest/gtest.h> namespace android { @@ -22,7 +21,7 @@ TEST(DvrGlobalBufferTest, TestGlobalBuffersSameName) { DvrBuffer* buffer2 = nullptr; int ret2 = dvrSetupGlobalBuffer(buffer_key, 10, 0, &buffer2); - ASSERT_EQ(0, ret1); + ASSERT_EQ(0, ret2); ASSERT_NE(nullptr, buffer2); AHardwareBuffer* hardware_buffer1 = nullptr; @@ -159,7 +158,7 @@ TEST(DvrGlobalBufferTest, TestGlobalBufferCarriesData) { ASSERT_EQ(0, e3); ASSERT_NE(nullptr, buffer); // Verify that the buffer pointer is at least 16 byte aligned. - ASSERT_EQ(0, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); + ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); uint64_t* data = static_cast<uint64_t*>(buffer); constexpr size_t num_values = size / sizeof(uint64_t); @@ -192,7 +191,7 @@ TEST(DvrGlobalBufferTest, TestGlobalBufferCarriesData) { ASSERT_EQ(0, e3); ASSERT_NE(nullptr, buffer); // Verify that the buffer pointer is at least 16 byte aligned. - ASSERT_EQ(0, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); + ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); uint64_t* data = static_cast<uint64_t*>(buffer); constexpr size_t num_values = size / sizeof(uint64_t); @@ -233,7 +232,7 @@ TEST(DvrGlobalBufferTest, TestGlobalBufferZeroed) { ASSERT_EQ(0, e3); ASSERT_NE(nullptr, buffer); // Verify that the buffer pointer is at least 16 byte aligned. - ASSERT_EQ(0, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); + ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(buffer) & (16 - 1)); uint64_t* data = static_cast<uint64_t*>(buffer); constexpr size_t num_values = size / sizeof(uint64_t); @@ -241,7 +240,7 @@ TEST(DvrGlobalBufferTest, TestGlobalBufferZeroed) { for (size_t i = 0; i < num_values; ++i) { zero |= data[i]; } - ASSERT_EQ(0, zero); + ASSERT_EQ(0U, zero); int32_t fence = -1; int e4 = AHardwareBuffer_unlock(hardware_buffer, &fence); |