diff options
author | Jeff McGlynn <jwmcglynn@google.com> | 2018-08-07 19:03:06 -0700 |
---|---|---|
committer | Jeff McGlynn <jwmcglynn@google.com> | 2018-08-07 19:17:01 -0700 |
commit | d16f2f6c3c7c2f899fde35782e1ee978877bb14b (patch) | |
tree | 877265e53f23c6898638daeb36bb4c41e2a05847 /src/decoder/test/intermediate_astc_block_test.cc | |
parent | 6b50058889099e4287f683b97a86ca74607172c4 (diff) |
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".
Diffstat (limited to 'src/decoder/test/intermediate_astc_block_test.cc')
-rw-r--r-- | src/decoder/test/intermediate_astc_block_test.cc | 7 |
1 files changed, 4 insertions, 3 deletions
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 { |