From ae3a1e5d17d5c8ab8c9dcf20cf60a68744f5cca0 Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Thu, 29 Nov 2012 10:28:26 -0800 Subject: [2506] handled the case a number is expected but not found --- src/lib/dns/tests/master_lexer_token_unittest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/dns/tests/master_lexer_token_unittest.cc') 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" -- cgit v1.2.3