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 /base/allocator | |
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 'base/allocator')
-rw-r--r-- | base/allocator/allocator_unittests.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/base/allocator/allocator_unittests.cc b/base/allocator/allocator_unittests.cc index b1aa9cb..d935cf9 100644 --- a/base/allocator/allocator_unittests.cc +++ b/base/allocator/allocator_unittests.cc @@ -313,9 +313,9 @@ static void TestOneNewWithoutExceptions(void* (*func)(size_t), try { void* rv = (*func)(kTooBig); EXPECT_EQ(NULL, rv); - EXPECT_EQ(false, should_throw) << "allocation should have thrown."; + EXPECT_FALSE(should_throw) << "allocation should have thrown."; } catch(...) { - EXPECT_EQ(true, should_throw) << "allocation threw unexpected exception."; + EXPECT_TRUE(should_throw) << "allocation threw unexpected exception."; } } @@ -359,7 +359,7 @@ TEST(Allocators, Malloc) { unsigned char* ptr = reinterpret_cast<unsigned char*>(malloc(size)); CheckAlignment(ptr, 2); // Should be 2 byte aligned Fill(ptr, size); - EXPECT_EQ(true, Valid(ptr, size)); + EXPECT_TRUE(Valid(ptr, size)); free(ptr); } } @@ -420,9 +420,9 @@ TEST(Allocators, Realloc2) { Fill(src, src_size); unsigned char* dst = reinterpret_cast<unsigned char*>(realloc(src, dst_size)); - EXPECT_EQ(true, Valid(dst, min(src_size, dst_size))); + EXPECT_TRUE(Valid(dst, min(src_size, dst_size))); Fill(dst, dst_size); - EXPECT_EQ(true, Valid(dst, dst_size)); + EXPECT_TRUE(Valid(dst, dst_size)); if (dst != NULL) free(dst); } } @@ -468,13 +468,13 @@ TEST(Allocators, Recalloc) { for (int dst_size = 0; dst_size >= 0; dst_size = NextSize(dst_size)) { unsigned char* src = reinterpret_cast<unsigned char*>(_recalloc(NULL, 1, src_size)); - EXPECT_EQ(true, IsZeroed(src, src_size)); + EXPECT_TRUE(IsZeroed(src, src_size)); Fill(src, src_size); unsigned char* dst = reinterpret_cast<unsigned char*>(_recalloc(src, 1, dst_size)); - EXPECT_EQ(true, Valid(dst, min(src_size, dst_size))); + EXPECT_TRUE(Valid(dst, min(src_size, dst_size))); Fill(dst, dst_size); - EXPECT_EQ(true, Valid(dst, dst_size)); + EXPECT_TRUE(Valid(dst, dst_size)); if (dst != NULL) free(dst); } |