]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2389] added test cases involving internal lexer error.
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 25 Feb 2013 22:07:28 +0000 (14:07 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 25 Feb 2013 22:07:28 +0000 (14:07 -0800)
src/lib/dns/tests/rdata_in_a_unittest.cc
src/lib/dns/tests/rdata_in_aaaa_unittest.cc

index 8e851c1741ebd96196cdff3f24a4c34942bb1f58..ac05c2c5e084b2851b54b5a38c8b5ec8f48c6acd 100644 (file)
@@ -82,6 +82,11 @@ TEST_F(Rdata_IN_A_Test, createFromText) {
 
     // a valid address surrounded by parentheses; only okay with lexer
     checkFromTextIN_A("(192.0.2.1)", true, false);
+
+    // input that would cause lexer-specific error; it's bad text as an
+    // address so should result in the string version, too.
+    checkFromText<in::A, InvalidRdataText, MasterLexer::LexerError>(
+        ")192.0.2.1", rdata_in_a);
 }
 
 TEST_F(Rdata_IN_A_Test, createFromWire) {
index 78b9929371c44f59428b980371451c59d8ecc2ef..82f75a897c20fe53f441bc71bdc621cc211ff459 100644 (file)
@@ -83,6 +83,11 @@ TEST_F(Rdata_IN_AAAA_Test, createFromText) {
 
     // a valid address surrounded by parentheses; only okay with lexer
     checkFromTextIN_AAAA("(2001:db8::1234)", true, false);
+
+    // input that would cause lexer-specific error; it's bad text as an
+    // address so should result in the string version, too.
+    checkFromText<in::AAAA, InvalidRdataText, MasterLexer::LexerError>(
+        ")2001:db8::1234", rdata_in_aaaa);
 }
 
 TEST_F(Rdata_IN_AAAA_Test, createFromWire) {