From 22c70125a888930effa9d10d6afc4f8188d94691 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 6 Mar 2017 13:00:13 -0800 Subject: Tidy xfa_utils_unittest.cpp Testing idempotency of const method kinda silly. Change nodes used in some tests. Add intermediate check in one test Rename one test case. Change-Id: Ib4cbb56665d0e0933561bb240205edeffdd74900 Reviewed-on: https://pdfium-review.googlesource.com/2931 Commit-Queue: Tom Sepez Reviewed-by: dsinclair --- xfa/fxfa/parser/xfa_utils_unittest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/xfa_utils_unittest.cpp b/xfa/fxfa/parser/xfa_utils_unittest.cpp index 4c7f47bbb1..c39ed69306 100644 --- a/xfa/fxfa/parser/xfa_utils_unittest.cpp +++ b/xfa/fxfa/parser/xfa_utils_unittest.cpp @@ -122,7 +122,6 @@ TEST_F(XFANodeIteratorTest, Root) { Iterator iter(root()); EXPECT_EQ(root(), iter.GetRoot()); EXPECT_EQ(root(), iter.GetCurrent()); - EXPECT_EQ(root(), iter.GetCurrent()); } TEST_F(XFANodeIteratorTest, Current) { @@ -130,10 +129,9 @@ TEST_F(XFANodeIteratorTest, Current) { iter.SetCurrent(child1()); EXPECT_EQ(root(), iter.GetRoot()); EXPECT_EQ(child1(), iter.GetCurrent()); - EXPECT_EQ(child1(), iter.GetCurrent()); } -TEST_F(XFANodeIteratorTest, CurrentOutsideRoot) { +TEST_F(XFANodeIteratorTest, CurrentOutsideRootDisallowed) { Iterator iter(child1()); iter.SetCurrent(root()); EXPECT_EQ(child1(), iter.GetRoot()); @@ -153,7 +151,10 @@ TEST_F(XFANodeIteratorTest, CurrentNull) { TEST_F(XFANodeIteratorTest, MoveToPrev) { Iterator iter(root()); - iter.SetCurrent(child8()); + iter.SetCurrent(child9()); + + EXPECT_EQ(child8(), iter.MoveToPrev()); + EXPECT_EQ(child8(), iter.GetCurrent()); EXPECT_EQ(child7(), iter.MoveToPrev()); EXPECT_EQ(child7(), iter.GetCurrent()); @@ -242,6 +243,7 @@ TEST_F(XFANodeIteratorTest, BackAndForth) { TEST_F(XFANodeIteratorTest, NextFromBeforeTheBeginning) { Iterator iter(root()); EXPECT_EQ(nullptr, iter.MoveToPrev()); + EXPECT_EQ(root(), iter.GetCurrent()); EXPECT_EQ(child1(), iter.MoveToNext()); } -- cgit v1.2.3