diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-11-04 17:56:23 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2011-11-04 17:56:23 +0000 |
commit | 93fed47dbf8e6bc3d39d3f769cb5039551747257 (patch) | |
tree | ab0e0f5e0fd23697673ec2e0edca67079375dd2c /samples/sample2_unittest.cc | |
parent | f46f3eaf059b7b3ca00a3428c594bd477bc1839c (diff) | |
download | googletest-93fed47dbf8e6bc3d39d3f769cb5039551747257.tar.gz |
Improves conformance to the Google C++ Style Guide (by Greg Miller).
git-svn-id: http://googletest.googlecode.com/svn/trunk@607 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'samples/sample2_unittest.cc')
-rw-r--r-- | samples/sample2_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/sample2_unittest.cc b/samples/sample2_unittest.cc index 3792fa5..4fa19b7 100644 --- a/samples/sample2_unittest.cc +++ b/samples/sample2_unittest.cc @@ -79,7 +79,7 @@ const char kHelloString[] = "Hello, world!"; // Tests the c'tor that accepts a C string. TEST(MyString, ConstructorFromCString) { const MyString s(kHelloString); - EXPECT_TRUE(strcmp(s.c_string(), kHelloString) == 0); + EXPECT_EQ(0, strcmp(s.c_string(), kHelloString)); EXPECT_EQ(sizeof(kHelloString)/sizeof(kHelloString[0]) - 1, s.Length()); } @@ -88,7 +88,7 @@ TEST(MyString, ConstructorFromCString) { TEST(MyString, CopyConstructor) { const MyString s1(kHelloString); const MyString s2 = s1; - EXPECT_TRUE(strcmp(s2.c_string(), kHelloString) == 0); + EXPECT_EQ(0, strcmp(s2.c_string(), kHelloString)); } // Tests the Set method. @@ -96,12 +96,12 @@ TEST(MyString, Set) { MyString s; s.Set(kHelloString); - EXPECT_TRUE(strcmp(s.c_string(), kHelloString) == 0); + EXPECT_EQ(0, strcmp(s.c_string(), kHelloString)); // Set should work when the input pointer is the same as the one // already in the MyString object. s.Set(s.c_string()); - EXPECT_TRUE(strcmp(s.c_string(), kHelloString) == 0); + EXPECT_EQ(0, strcmp(s.c_string(), kHelloString)); // Can we set the MyString to NULL? s.Set(NULL); |