summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/tests/master_lexer_token_unittest.cc
diff options
context:
space:
mode:
authorJINMEI Tatuya <jinmei@isc.org>2012-11-29 19:28:26 +0100
committerJINMEI Tatuya <jinmei@isc.org>2012-11-29 19:28:26 +0100
commitae3a1e5d17d5c8ab8c9dcf20cf60a68744f5cca0 (patch)
tree33777b26a0817e99dd5ec05d76c6f415ed677d4c /src/lib/dns/tests/master_lexer_token_unittest.cc
parent[2506] supported NUMBER in getNextToken() with expected type (diff)
downloadkea-ae3a1e5d17d5c8ab8c9dcf20cf60a68744f5cca0.tar.xz
kea-ae3a1e5d17d5c8ab8c9dcf20cf60a68744f5cca0.zip
[2506] handled the case a number is expected but not found
Diffstat (limited to 'src/lib/dns/tests/master_lexer_token_unittest.cc')
-rw-r--r--src/lib/dns/tests/master_lexer_token_unittest.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/dns/tests/master_lexer_token_unittest.cc b/src/lib/dns/tests/master_lexer_token_unittest.cc
index 7cb83a5fa8..89a4f9c593 100644
--- a/src/lib/dns/tests/master_lexer_token_unittest.cc
+++ b/src/lib/dns/tests/master_lexer_token_unittest.cc
@@ -141,15 +141,17 @@ TEST_F(MasterLexerTokenTest, errors) {
EXPECT_EQ("number out of range",
MasterToken(MasterToken::NUMBER_OUT_OF_RANGE).
getErrorText());
+ EXPECT_EQ("not a valid number",
+ MasterToken(MasterToken::BAD_NUMBER).getErrorText());
// getErrorCode/Text() isn't allowed for non number types
EXPECT_THROW(token_num.getErrorCode(), isc::InvalidOperation);
EXPECT_THROW(token_num.getErrorText(), isc::InvalidOperation);
- // Only the pre-defined error code is accepted. Hardcoding '6' (max code
+ // Only the pre-defined error code is accepted. Hardcoding '7' (max code
// + 1) is intentional; it'd be actually better if we notice it when we
// update the enum list (which shouldn't happen too often).
- EXPECT_THROW(MasterToken(MasterToken::ErrorCode(6)),
+ EXPECT_THROW(MasterToken(MasterToken::ErrorCode(7)),
isc::InvalidParameter);
// Check the coexistence of "from number" and "from error-code"