Browse Source

[2497] Add a direct HINFO testcase for the string parser

Mukund Sivaraman 12 years ago
parent
commit
ec24cb1c27
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/lib/dns/tests/rdata_hinfo_unittest.cc

+ 2 - 0
src/lib/dns/tests/rdata_hinfo_unittest.cc

@@ -41,6 +41,7 @@ static uint8_t hinfo_rdata[] = {0x07,0x50,0x65,0x6e,0x74,0x69,0x75,0x6d,0x05,
 static const char *hinfo_str = "\"Pentium\" \"Linux\"";
 static const char *hinfo_str1 = "\"Pen\\\"tium\" \"Linux\"";
 
+static const char *hinfo_str_equal = "\"Pentium\"\"Linux\"";
 static const char *hinfo_str_small1 = "\"Lentium\" \"Linux\"";
 static const char *hinfo_str_small2 = "\"Pentium\" \"Kinux\"";
 static const char *hinfo_str_large1 = "\"Qentium\" \"Linux\"";
@@ -127,6 +128,7 @@ TEST_F(Rdata_HINFO_Test, compare) {
     HINFO hinfo_large2(hinfo_str_large2);
 
     EXPECT_EQ(0, hinfo.compare(HINFO(hinfo_str)));
+    EXPECT_EQ(0, hinfo.compare(HINFO(hinfo_str_equal)));
     EXPECT_EQ(1, hinfo.compare(HINFO(hinfo_str_small1)));
     EXPECT_EQ(1, hinfo.compare(HINFO(hinfo_str_small2)));
     EXPECT_EQ(-1, hinfo.compare(HINFO(hinfo_str_large1)));