diff options
Diffstat (limited to 'googletest/samples/sample4_unittest.cc')
-rw-r--r-- | googletest/samples/sample4_unittest.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/googletest/samples/sample4_unittest.cc b/googletest/samples/sample4_unittest.cc index 7bf9ea3..d5144c0 100644 --- a/googletest/samples/sample4_unittest.cc +++ b/googletest/samples/sample4_unittest.cc @@ -26,8 +26,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) + #include "sample4.h" #include "gtest/gtest.h" @@ -38,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 |