diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-03-24 17:23:38 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-03-24 17:26:27 -0700 |
| commit | 04db3d5a50cf4deff6b385c3aef820b283800a4f (patch) | |
| tree | 005d2edfdc6df23c0301006a05ccc72de7324e00 /Source/UnitTests/Common/BitSetTest.cpp | |
| parent | c5cc781205be6125c9214cf0100b241e36491bd2 (diff) | |
UnitTests: use EXPECT_TRUE/EXPECT_FALSE (fixes warnings)
Using `EXPECT_EQ` with boolean literals can cause a warning in certain
versions of GCC. See https://github.com/google/googletest/issues/322
Fixes warnings:
```
../Source/UnitTests/Common/BitSetTest.cpp: In member function 'virtual void BitSet_Basics_Test::TestBody()':
../Source/UnitTests/Common/BitSetTest.cpp:15:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/BitSetTest.cpp: In member function 'virtual void BitSet_BitGetSet_Test::TestBody()':
../Source/UnitTests/Common/BitSetTest.cpp:27:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp: In member function 'virtual void StringUtil_StringBeginsWith_Test::TestBody()':
../Source/UnitTests/Common/StringUtilTest.cpp:23:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:25:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:26:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:27:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp: In member function 'virtual void StringUtil_StringEndsWith_Test::TestBody()':
../Source/UnitTests/Common/StringUtilTest.cpp:35:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:37:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:38:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:39:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
c
```
Diffstat (limited to 'Source/UnitTests/Common/BitSetTest.cpp')
| -rw-r--r-- | Source/UnitTests/Common/BitSetTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/UnitTests/Common/BitSetTest.cpp b/Source/UnitTests/Common/BitSetTest.cpp index dddd8f49d5..37831e4d0c 100644 --- a/Source/UnitTests/Common/BitSetTest.cpp +++ b/Source/UnitTests/Common/BitSetTest.cpp @@ -11,8 +11,8 @@ TEST(BitSet, Basics) BitSet32 bs; BitSet64 bs2(1); BitSet64 bs3(2); - EXPECT_EQ(true, !!bs2); - EXPECT_EQ(false, !!bs); + EXPECT_TRUE(!!bs2); + EXPECT_FALSE(!!bs); EXPECT_EQ(bs2, bs2); EXPECT_NE(bs2, bs3); EXPECT_EQ(BitSet32(0xfff), BitSet32::AllTrue(12)); @@ -23,8 +23,8 @@ TEST(BitSet, BitGetSet) { BitSet32 bs; bs[3] = bs[8] = bs[11] = true; - EXPECT_EQ(true, bs[3]); - EXPECT_EQ(false, bs[4]); + EXPECT_TRUE(bs[3]); + EXPECT_FALSE(bs[4]); EXPECT_EQ((u32)((1 << 3) | (1 << 8) | (1 << 11)), bs.m_val); } |
