diff options
Diffstat (limited to 'googletest/samples/sample4_unittest.cc')
-rw-r--r-- | googletest/samples/sample4_unittest.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/googletest/samples/sample4_unittest.cc b/googletest/samples/sample4_unittest.cc index 079a70d..d5144c0 100644 --- a/googletest/samples/sample4_unittest.cc +++ b/googletest/samples/sample4_unittest.cc @@ -37,12 +37,17 @@ namespace { TEST(Counter, Increment) { Counter c; + // Test that counter 0 returns 0 + EXPECT_EQ(0, c.Decrement()); + // EXPECT_EQ() evaluates its arguments exactly once, so they // can have side effects. EXPECT_EQ(0, c.Increment()); EXPECT_EQ(1, c.Increment()); EXPECT_EQ(2, c.Increment()); + + EXPECT_EQ(3, c.Decrement()); } } // namespace |