Parcourir la source

[2522] updated 'missing origin' tests so we test all names

also constify one variable.
JINMEI Tatuya il y a 12 ans
Parent
commit
0b2800af6e

+ 2 - 1
src/lib/dns/tests/rdata_minfo_unittest.cc

@@ -123,7 +123,8 @@ TEST_F(Rdata_MINFO_Test, badText) {
     checkFromText_LexerError("root.example.com.");
 
     // missing origin
-    checkFromText_MissingOrigin("root.example.com emailbox.example.com");
+    checkFromText_MissingOrigin("root.example.com emailbox.example.com.");
+    checkFromText_MissingOrigin("root.example.com. emailbox.example.com");
 }
 
 TEST_F(Rdata_MINFO_Test, createFromWire) {

+ 3 - 2
src/lib/dns/tests/rdata_rp_unittest.cc

@@ -87,7 +87,7 @@ TEST_F(Rdata_RP_Test, createFromText) {
     checkFromText_None("root.example.com. rp-text.example.com.");
 
     // origin defined for lexer constructor, but not string constructor
-    Name origin("example.com");
+    const Name origin("example.com");
     checkFromText_Origin("root rp-text", &origin);
 
     // lexer constructor accepts extra text, but string constructor doesn't
@@ -104,7 +104,8 @@ TEST_F(Rdata_RP_Test, badText) {
     checkFromText_LexerError("root.example.com.");
 
     // missing origin
-    checkFromText_MissingOrigin("root.example.com rp-text.example.com");
+    checkFromText_MissingOrigin("root.example.com rp-text.example.com.");
+    checkFromText_MissingOrigin("root.example.com. rp-text.example.com");
 }
 
 TEST_F(Rdata_RP_Test, createFromWire) {