From 07448c2929cb9ad7fb47369940aa758d08335f79 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Thu, 26 Jan 2023 01:23:03 +0900 Subject: [PATCH] Fix compiler warning discovered by clang-r484482 external/googletest/googletest/include/gtest/gtest.h:1545:11: error: invalid operands to binary expression ('const std::vector' and 'const android::hardware::hidl_vec') [clang-diagnostic-error] if (lhs == rhs) { ~~~ ^ ~~~ Test: presubmit Change-Id: Iabe98a58d5dc5b9943c38240da2d8df6ac61fb7f --- .../mapper/stable-c/implutils/impltests.cpp | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/graphics/mapper/stable-c/implutils/impltests.cpp b/graphics/mapper/stable-c/implutils/impltests.cpp index f12b069c3f..01a1db9078 100644 --- a/graphics/mapper/stable-c/implutils/impltests.cpp +++ b/graphics/mapper/stable-c/implutils/impltests.cpp @@ -359,35 +359,35 @@ TEST(MetadataGralloc4Interop, BufferId) { auto mpbuf = encode(42); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeBufferId(42, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Name) { auto mpbuf = encode("Hello, Interop!"); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeName("Hello, Interop!", &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Width) { auto mpbuf = encode(128); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeWidth(128, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Height) { auto mpbuf = encode(64); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeHeight(64, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, LayerCount) { auto mpbuf = encode(3); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeLayerCount(3, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, PixelFormatRequested) { @@ -395,21 +395,21 @@ TEST(MetadataGralloc4Interop, PixelFormatRequested) { hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatRequested( hardware::graphics::common::V1_2::PixelFormat::RGBX_8888, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, PixelFormatFourcc) { auto mpbuf = encode(DRM_FORMAT_ABGR8888); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatFourCC(DRM_FORMAT_ABGR8888, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, PixelFormatModifier) { auto mpbuf = encode(123456); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodePixelFormatModifier(123456, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Usage) { @@ -420,21 +420,21 @@ TEST(MetadataGralloc4Interop, Usage) { static_cast( hardware::graphics::common::V1_2::BufferUsage::COMPOSER_OVERLAY), &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, AllocationSize) { auto mpbuf = encode(10200); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeAllocationSize(10200, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, ProtectedContent) { auto mpbuf = encode(1); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeProtectedContent(1, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Compression) { @@ -443,14 +443,14 @@ TEST(MetadataGralloc4Interop, Compression) { hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeCompression(gralloc4::Compression_DisplayStreamCompression, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Interlaced) { auto mpbuf = encode(gralloc4::Interlaced_TopBottom); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeInterlaced(gralloc4::Interlaced_TopBottom, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, ChromeSitting) { @@ -459,14 +459,14 @@ TEST(MetadataGralloc4Interop, ChromeSitting) { hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeChromaSiting(gralloc4::ChromaSiting_SitedInterstitial, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, PlaneLayouts) { auto mpbuf = encode(fakePlaneLayouts()); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodePlaneLayouts(fakePlaneLayouts(), &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Crop) { @@ -474,21 +474,21 @@ TEST(MetadataGralloc4Interop, Crop) { auto mpbuf = encode(cropRects); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeCrop(cropRects, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Dataspace) { auto mpbuf = encode(Dataspace::DISPLAY_P3); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::DISPLAY_P3, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, BlendMode) { auto mpbuf = encode(BlendMode::PREMULTIPLIED); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeBlendMode(BlendMode::PREMULTIPLIED, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Smpte2086) { @@ -498,7 +498,7 @@ TEST(MetadataGralloc4Interop, Smpte2086) { auto mpbuf = encode(hdrdata); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2086(hdrdata, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Cta861_3) { @@ -506,29 +506,29 @@ TEST(MetadataGralloc4Interop, Cta861_3) { auto mpbuf = encode(hdrdata); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeCta861_3(hdrdata, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Smpte2094_10) { auto mpbuf = encode(std::nullopt); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_10(std::nullopt, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); std::vector hdrdata{1, 2, 3, 4, 5, 6}; mpbuf = encode(hdrdata); ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_10(hdrdata, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); } TEST(MetadataGralloc4Interop, Smpte2094_40) { auto mpbuf = encode(std::nullopt); hidl_vec g4buf; ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_40(std::nullopt, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); std::vector hdrdata{1, 2, 3, 4, 5, 6}; mpbuf = encode(hdrdata); ASSERT_EQ(NO_ERROR, gralloc4::encodeSmpte2094_40(hdrdata, &g4buf)); - EXPECT_EQ(mpbuf, g4buf); + EXPECT_EQ(g4buf, mpbuf); }