BIND 10 trac2369, updated. 2c8d3ac2d8d62ef77c0f888a7c334689ebcd9b5b [2369] Check saveLine() + ungetAll()
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Oct 29 04:28:55 UTC 2012
The branch, trac2369 has been updated
via 2c8d3ac2d8d62ef77c0f888a7c334689ebcd9b5b (commit)
from a6093a8ef88a556bb0c6094d11863e700ec8242f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2c8d3ac2d8d62ef77c0f888a7c334689ebcd9b5b
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Oct 29 09:45:52 2012 +0530
[2369] Check saveLine() + ungetAll()
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/tests/inputsource_unittest.cc | 32 +++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/inputsource_unittest.cc b/src/lib/dns/tests/inputsource_unittest.cc
index dc0a39a..4c7bf5c 100644
--- a/src/lib/dns/tests/inputsource_unittest.cc
+++ b/src/lib/dns/tests/inputsource_unittest.cc
@@ -168,4 +168,36 @@ TEST_F(InputSourceTest, lines) {
EXPECT_EQ(1, source_.getCurrentLine());
}
+// ungetAll() after saveLine() should skip back to the last-saved place.
+TEST_F(InputSourceTest, saveLine) {
+ // First, skip to line 2.
+ while (!source_.atEOF() &&
+ (source_.getCurrentLine() != 2)) {
+ source_.getChar();
+ }
+ EXPECT_FALSE(source_.atEOF());
+ size_t line = source_.getCurrentLine();
+ EXPECT_EQ(2, line);
+
+ // Now, save the line.
+ source_.saveLine();
+
+ // Now, go to EOF
+ while (!source_.atEOF()) {
+ source_.getChar();
+ }
+ line = source_.getCurrentLine();
+
+ // Now, we are at EOF.
+ EXPECT_TRUE(source_.atEOF());
+ EXPECT_EQ(4, line);
+
+ // Now, ungetAll() and check where it goes back.
+ source_.ungetAll();
+
+ // Now we are back to where we last-saved.
+ EXPECT_EQ(2, source_.getCurrentLine());
+ EXPECT_FALSE(source_.atEOF());
+}
+
} // end namespace
More information about the bind10-changes
mailing list