diff options
Diffstat (limited to 'googletest/samples/sample2_unittest.cc')
-rw-r--r-- | googletest/samples/sample2_unittest.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/googletest/samples/sample2_unittest.cc b/googletest/samples/sample2_unittest.cc index 4fa19b7..41e31c1 100644 --- a/googletest/samples/sample2_unittest.cc +++ b/googletest/samples/sample2_unittest.cc @@ -28,9 +28,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // A sample program demonstrating using Google C++ testing framework. -// -// Author: wan@google.com (Zhanyong Wan) - // This sample shows how to write a more complex unit test for a class // that has multiple member functions. @@ -42,7 +39,7 @@ #include "sample2.h" #include "gtest/gtest.h" - +namespace { // In this example, we test the MyString class (a simple string). // Tests the default c'tor. @@ -69,7 +66,7 @@ TEST(MyString, DefaultConstructor) { // we have to live with this fact. // // </TechnicalDetails> - EXPECT_STREQ(NULL, s.c_string()); + EXPECT_STREQ(nullptr, s.c_string()); EXPECT_EQ(0u, s.Length()); } @@ -104,6 +101,7 @@ TEST(MyString, Set) { EXPECT_EQ(0, strcmp(s.c_string(), kHelloString)); // Can we set the MyString to NULL? - s.Set(NULL); - EXPECT_STREQ(NULL, s.c_string()); + s.Set(nullptr); + EXPECT_STREQ(nullptr, s.c_string()); } +} // namespace |