diff options
author | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 10:36:28 +0000 |
---|---|---|
committer | hans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 10:36:28 +0000 |
commit | 515f2492fbc0a023eb089e91e349106da325de5e (patch) | |
tree | d606fd354fe6c4695fe2f635e62774fe582e8232 /o3d | |
parent | a834a1abc0a318a563d9a0eb3adec0df2947a982 (diff) | |
download | chromium_src-515f2492fbc0a023eb089e91e349106da325de5e.zip chromium_src-515f2492fbc0a023eb089e91e349106da325de5e.tar.gz chromium_src-515f2492fbc0a023eb089e91e349106da325de5e.tar.bz2 |
Clang: enable -Wbool-conversions and -Wunused-variables on Linux.
-Wbool-conversion warns about EXPECT_EQ(false, blah), so replace
that with EXPECT_FALSE(blah). Do the same with EXPECT_EQ(true, blah)
for good measure (even though that doesn't generate warnings).
Also remove the one instance of an unused variable.
BUG=69421
TEST=buildbots all compile and all tests pass
Review URL: http://codereview.chromium.org/6300001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71431 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/utils/cross/file_text_reader_test.cc | 50 | ||||
-rw-r--r-- | o3d/utils/cross/string_reader_test.cc | 38 |
2 files changed, 44 insertions, 44 deletions
diff --git a/o3d/utils/cross/file_text_reader_test.cc b/o3d/utils/cross/file_text_reader_test.cc index 9b98c63..951e3429 100644 --- a/o3d/utils/cross/file_text_reader_test.cc +++ b/o3d/utils/cross/file_text_reader_test.cc @@ -121,21 +121,21 @@ TEST_F(FileTextReaderTest, StartAtBeginning) { FileTextReader reader(file_pointers_[0]); EXPECT_EQ(0U, reader.position()); EXPECT_EQ(file_pointers_[0], reader.input()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); } TEST_F(FileTextReaderTest, TestPeekString) { FileTextReader reader(file_pointers_[0]); EXPECT_EQ(test_string_one_.substr(0, 6), reader.PeekString(6)); EXPECT_EQ(0U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); } TEST_F(FileTextReaderTest, ReadsSingleCharacter) { FileTextReader reader(file_pointers_[0]); EXPECT_EQ(test_string_one_.substr(0, 1)[0], reader.ReadChar()); EXPECT_EQ(1U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(1, 2), reader.PeekString(2)); EXPECT_EQ(1U, reader.position()); } @@ -145,7 +145,7 @@ TEST_F(FileTextReaderTest, ReadsMultipleCharacters) { EXPECT_EQ(test_string_one_.substr(0, 1)[0], reader.ReadChar()); EXPECT_EQ(test_string_one_.substr(1, 1)[0], reader.ReadChar()); EXPECT_EQ(2U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(2, 2), reader.PeekString(2)); EXPECT_EQ(2U, reader.position()); } @@ -154,7 +154,7 @@ TEST_F(FileTextReaderTest, ReadsFile) { FileTextReader reader(file_pointers_[0]); EXPECT_EQ(test_string_one_.substr(0, 7), reader.ReadString(7)); EXPECT_EQ(7U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(7, 2), reader.PeekString(2)); EXPECT_EQ(7U, reader.position()); } @@ -163,27 +163,27 @@ TEST_F(FileTextReaderTest, EmptyFile) { FileTextReader reader(file_pointers_[8]); EXPECT_EQ("", reader.PeekString(1)); EXPECT_EQ(0U, reader.position()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(0, reader.ReadChar()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); } TEST_F(FileTextReaderTest, TinyFile) { FileTextReader reader(file_pointers_[7]); EXPECT_EQ(test_string_short_.substr(0, 1), reader.PeekString(1)); EXPECT_EQ(0U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_short_[0], reader.ReadChar()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); } TEST_F(FileTextReaderTest, ReadsToEnd) { FileTextReader reader(file_pointers_[2]); EXPECT_EQ(test_string_lf_, reader.ReadToEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadString(1)); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); } @@ -193,12 +193,12 @@ TEST_F(FileTextReaderTest, ReadsLinefeedFile) { std::string line = reader.ReadLine(); EXPECT_EQ(test_string_one_, line); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); } @@ -206,12 +206,12 @@ TEST_F(FileTextReaderTest, ReadsCarriageReturnFile) { FileTextReader reader(file_pointers_[3]); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_cr_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_cr_.size(), reader.position()); } @@ -220,12 +220,12 @@ TEST_F(FileTextReaderTest, ReadsCarriageReturnLinefeedFile) { FileTextReader reader(file_pointers_[4]); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 2, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_crlf_.substr(test_string_one_.size() + 2, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 2, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_crlf_.size(), reader.position()); } @@ -233,16 +233,16 @@ TEST_F(FileTextReaderTest, ReadsLinefeedCarriageReturnFile) { FileTextReader reader(file_pointers_[5]); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lfcr_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lfcr_.size(), reader.position()); } @@ -250,16 +250,16 @@ TEST_F(FileTextReaderTest, ReadsLinefeedLinefeedFile) { FileTextReader reader(file_pointers_[6]); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lflf_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lflf_.size(), reader.position()); } diff --git a/o3d/utils/cross/string_reader_test.cc b/o3d/utils/cross/string_reader_test.cc index 742dc56..1afab5e 100644 --- a/o3d/utils/cross/string_reader_test.cc +++ b/o3d/utils/cross/string_reader_test.cc @@ -88,7 +88,7 @@ TEST_F(StringReaderTest, ReadsSingleCharacter) { StringReader reader(test_string_one_); EXPECT_EQ(test_string_one_.substr(0, 1)[0], reader.ReadChar()); EXPECT_EQ(1U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(1, 2), reader.PeekString(2)); EXPECT_EQ(1U, reader.position()); } @@ -98,7 +98,7 @@ TEST_F(StringReaderTest, ReadsMultipleCharacters) { EXPECT_EQ(test_string_one_.substr(0, 1)[0], reader.ReadChar()); EXPECT_EQ(test_string_one_.substr(1, 1)[0], reader.ReadChar()); EXPECT_EQ(2U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(2, 2), reader.PeekString(2)); EXPECT_EQ(2U, reader.position()); } @@ -107,7 +107,7 @@ TEST_F(StringReaderTest, ReadsString) { StringReader reader(test_string_one_); EXPECT_EQ(test_string_one_.substr(0, 7), reader.ReadString(7)); EXPECT_EQ(7U, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_one_.substr(7, 2), reader.PeekString(2)); EXPECT_EQ(7U, reader.position()); } @@ -116,9 +116,9 @@ TEST_F(StringReaderTest, ReadsToEnd) { StringReader reader(test_string_lf_); EXPECT_EQ(test_string_lf_, reader.ReadToEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadString(1)); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); } @@ -128,12 +128,12 @@ TEST_F(StringReaderTest, ReadsLinefeedString) { std::string line = reader.ReadLine(); EXPECT_EQ(test_string_one_, line); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lf_.size(), reader.position()); } @@ -141,12 +141,12 @@ TEST_F(StringReaderTest, ReadsCarriageReturnString) { StringReader reader(test_string_cr_); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_cr_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_cr_.size(), reader.position()); } @@ -155,12 +155,12 @@ TEST_F(StringReaderTest, ReadsCarriageReturnLinefeedString) { StringReader reader(test_string_crlf_); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 2, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_crlf_.substr(test_string_one_.size() + 2, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 2, reader.position()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_crlf_.size(), reader.position()); } @@ -168,16 +168,16 @@ TEST_F(StringReaderTest, ReadsLinefeedCarriageReturnString) { StringReader reader(test_string_lfcr_); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lfcr_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lfcr_.size(), reader.position()); } @@ -185,16 +185,16 @@ TEST_F(StringReaderTest, ReadsLinefeedLinefeedString) { StringReader reader(test_string_lflf_); EXPECT_EQ(test_string_one_, reader.ReadLine()); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_lflf_.substr(test_string_one_.size() + 1, 2), reader.PeekString(2)); EXPECT_EQ(test_string_one_.size() + 1, reader.position()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ(test_string_two_, reader.ReadLine()); - EXPECT_EQ(false, reader.IsAtEnd()); + EXPECT_FALSE(reader.IsAtEnd()); EXPECT_EQ("", reader.ReadLine()); - EXPECT_EQ(true, reader.IsAtEnd()); + EXPECT_TRUE(reader.IsAtEnd()); EXPECT_EQ(test_string_lflf_.size(), reader.position()); } } // namespace o3d |