From 3a7515065b9f039565b5e234d71cdae8b6ddb964 Mon Sep 17 00:00:00 2001 From: Marissa Wall Date: Thu, 20 Feb 2020 10:41:47 -0800 Subject: [PATCH] gralloc4-vts: fix bad comparisions in VTS The parameter order of a couple checks is wrong. For example: EXPECT_GT(val1, val2) is EXPECT_TRUE(val1 > val2) so EXPECT_GT(0, X) can never be true. Update the tests to be correct. Test: VtsHalGraphicsMapperV4_0 Bug: 149739702 Change-Id: I21070a912b6014acc5feb63b6b19912b45fe8f5f --- .../vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp index 1416fcc239..71e6debcba 100644 --- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp +++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp @@ -1990,7 +1990,7 @@ TEST_P(GraphicsMapperHidlTest, ListSupportedMetadataTypes) { const auto& metadataType = description.metadataType; if (!gralloc4::isStandardMetadataType(metadataType)) { - EXPECT_GT(0, description.description.size()); + EXPECT_GT(description.description.size(), 0); continue; } @@ -2074,7 +2074,7 @@ TEST_P(GraphicsMapperHidlTest, GetReservedRegion) { auto info = mDummyDescriptorInfo; const int pageSize = getpagesize(); - ASSERT_GE(0, pageSize); + ASSERT_GE(pageSize, 0); std::vector requestedReservedSizes{1, 10, 333, static_cast(pageSize) / 2, static_cast(pageSize)}; @@ -2106,7 +2106,7 @@ TEST_P(GraphicsMapperHidlTest, GetLargeReservedRegion) { auto info = mDummyDescriptorInfo; const int pageSize = getpagesize(); - ASSERT_GE(0, pageSize); + ASSERT_GE(pageSize, 0); std::vector requestedReservedSizes{static_cast(pageSize) * 2, static_cast(pageSize) * 10, static_cast(pageSize) * 1000}; @@ -2144,7 +2144,7 @@ TEST_P(GraphicsMapperHidlTest, GetReservedRegionMultiple) { auto info = mDummyDescriptorInfo; const int pageSize = getpagesize(); - ASSERT_GE(0, pageSize); + ASSERT_GE(pageSize, 0); info.reservedSize = pageSize; ASSERT_NO_FATAL_FAILURE(bufferHandle = mGralloc->allocate(info, true));