From d16f2f6c3c7c2f899fde35782e1ee978877bb14b Mon Sep 17 00:00:00 2001 From: Jeff McGlynn Date: Tue, 7 Aug 2018 19:03:06 -0700 Subject: Fix build errors when used by the Android Emulator In the Android Emulator, there are two main differences: 1) googletest is the shared version 1.8.0, instead of the later commit used by astc-codec (to get bazel support). 2) Unit tests are all linked together into one binary, so one function needs to be marked "static". --- src/decoder/test/endpoint_codec_test.cc | 1 - src/decoder/test/image_utils.h | 2 +- src/decoder/test/intermediate_astc_block_test.cc | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/decoder/test/endpoint_codec_test.cc b/src/decoder/test/endpoint_codec_test.cc index f2fef54..de7d9ca 100644 --- a/src/decoder/test/endpoint_codec_test.cc +++ b/src/decoder/test/endpoint_codec_test.cc @@ -35,7 +35,6 @@ using ::testing::Eq; using ::testing::Ge; using ::testing::Le; using ::testing::Ne; -using ::testing::Optional; using ::testing::Pointwise; using ::testing::SizeIs; using ::testing::Pair; diff --git a/src/decoder/test/image_utils.h b/src/decoder/test/image_utils.h index 718696e..adfded5 100644 --- a/src/decoder/test/image_utils.h +++ b/src/decoder/test/image_utils.h @@ -116,7 +116,7 @@ static std::string LoadASTCFile(const std::string& basename) { } } -void LoadGoldenBmp(const std::string& path, ImageBuffer* result) { +static void LoadGoldenBmp(const std::string& path, ImageBuffer* result) { constexpr size_t kBmpHeaderSize = 54; SCOPED_TRACE(testing::Message() << "LoadGoldenBmp " << path); diff --git a/src/decoder/test/intermediate_astc_block_test.cc b/src/decoder/test/intermediate_astc_block_test.cc index 69935ef..41861cb 100644 --- a/src/decoder/test/intermediate_astc_block_test.cc +++ b/src/decoder/test/intermediate_astc_block_test.cc @@ -27,7 +27,6 @@ namespace { using ::testing::ElementsAre; using ::testing::Eq; using ::testing::HasSubstr; -using ::testing::Optional; using ::testing::SizeIs; using ::testing::TestWithParam; using ::testing::ValuesIn; @@ -313,7 +312,8 @@ TEST(IntermediateASTCBlockTest, TestPackingWithLargeGap) { // if we properly set the endpoint range. TEST(IntermediateASTCBlockTest, TestEndpointRange) { PhysicalASTCBlock blk(0x0000000001FE000173ULL); - EXPECT_THAT(blk.ColorValuesRange(), Optional(Eq(255))); + EXPECT_TRUE(blk.ColorValuesRange().hasValue()); + EXPECT_EQ(blk.ColorValuesRange().valueOr(0), 255); auto b = UnpackIntermediateBlock(blk); ASSERT_TRUE(b); @@ -322,7 +322,8 @@ TEST(IntermediateASTCBlockTest, TestEndpointRange) { ASSERT_THAT(data.endpoints, SizeIs(1)); EXPECT_THAT(data.endpoints[0].mode, Eq(ColorEndpointMode::kLDRLumaDirect)); EXPECT_THAT(data.endpoints[0].colors, ElementsAre(0, 255)); - EXPECT_THAT(data.endpoint_range, Optional(Eq(255))); + EXPECT_TRUE(data.endpoint_range.hasValue()); + EXPECT_EQ(data.endpoint_range.valueOr(0), 255); } struct ImageTestParams { -- cgit v1.2.3