BIND 10 trac2375-r1, updated. 99aed51b37494e262cccb3dc34d4b62a6969b48a [2375] Test ungetting after EOF

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Nov 19 16:27:50 UTC 2012


The branch, trac2375-r1 has been updated
       via  99aed51b37494e262cccb3dc34d4b62a6969b48a (commit)
       via  12aac746522dd1dda1d9082a0c7bf67c6b32f455 (commit)
      from  be89b811e83d3729ff7fb48ed9d0e16348532978 (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 99aed51b37494e262cccb3dc34d4b62a6969b48a
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Nov 19 17:27:33 2012 +0100

    [2375] Test ungetting after EOF

commit 12aac746522dd1dda1d9082a0c7bf67c6b32f455
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Nov 19 17:23:01 2012 +0100

    [2375] Check an unbalanced parenthesis is detected

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/tests/master_lexer_unittest.cc |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/master_lexer_unittest.cc b/src/lib/dns/tests/master_lexer_unittest.cc
index b076bfd..2eb0c3a 100644
--- a/src/lib/dns/tests/master_lexer_unittest.cc
+++ b/src/lib/dns/tests/master_lexer_unittest.cc
@@ -268,6 +268,22 @@ TEST_F(MasterLexerTest, eof) {
     EXPECT_EQ(MasterLexer::Token::END_OF_FILE, lexer.getNextToken().getType());
     // And it is not allowed to use this one any more.
     EXPECT_THROW(lexer.getNextToken(), isc::InvalidOperation);
+    // But if we unget a step back, we should get the EOF again
+    lexer.ungetToken();
+    EXPECT_EQ(MasterLexer::Token::END_OF_FILE, lexer.getNextToken().getType());
+}
+
+// Check we properly return error when there's an opened parentheses and no
+// closing one
+TEST_F(MasterLexerTest, getUnbalanced) {
+    ss << "(\"string\"";
+    lexer.pushSource(ss);
+
+    // The string gets out first
+    EXPECT_EQ(MasterLexer::Token::STRING, lexer.getNextToken().getType());
+    // Then an unbalanced parethsis
+    EXPECT_EQ(MasterLexer::Token::UNBALANCED_PAREN,
+              lexer.getNextToken().getErrorCode());
 }
 
 void



More information about the bind10-changes mailing list