summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-06 13:00:13 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-03-06 21:42:58 +0000
commit22c70125a888930effa9d10d6afc4f8188d94691 (patch)
tree16a1fb931a8695153aca4897368b6034834a0710 /xfa/fxfa/parser
parentd03ca4214e6db7123e1c2d0ea58e34f7cf67a568 (diff)
downloadpdfium-22c70125a888930effa9d10d6afc4f8188d94691.tar.xz
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 <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/xfa_utils_unittest.cpp10
1 files changed, 6 insertions, 4 deletions
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());
}