2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

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

This commit is contained in:
Mukund Sivaraman
2012-12-04 04:44:34 +05:30
committed by JINMEI Tatuya
parent 5f03da43d3
commit 5911431e8f

View File

@@ -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)));