|
@@ -40,8 +40,8 @@ class Rdata_PTR_Test : public RdataTest {
|
|
// there's nothing to specialize
|
|
// there's nothing to specialize
|
|
};
|
|
};
|
|
|
|
|
|
-const generic::PTR rdata_ptr("ns.example.com");
|
|
|
|
-const generic::PTR rdata_ptr2("ns2.example.com");
|
|
|
|
|
|
+const generic::PTR rdata_ptr("ns.example.com.");
|
|
|
|
+const generic::PTR rdata_ptr2("ns2.example.com.");
|
|
const uint8_t wiredata_ptr[] = {
|
|
const uint8_t wiredata_ptr[] = {
|
|
0x02, 0x6e, 0x73, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
|
|
0x02, 0x6e, 0x73, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x03,
|
|
0x63, 0x6f, 0x6d, 0x00 };
|
|
0x63, 0x6f, 0x6d, 0x00 };
|
|
@@ -54,15 +54,15 @@ const uint8_t wiredata_ptr2[] = {
|
|
0x03, 0x6e, 0x73, 0x32, 0xc0, 0x03 };
|
|
0x03, 0x6e, 0x73, 0x32, 0xc0, 0x03 };
|
|
|
|
|
|
TEST_F(Rdata_PTR_Test, createFromText) {
|
|
TEST_F(Rdata_PTR_Test, createFromText) {
|
|
- EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("ns.example.com")));
|
|
|
|
|
|
+ EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("ns.example.com.")));
|
|
// explicitly add a trailing dot. should be the same RDATA.
|
|
// explicitly add a trailing dot. should be the same RDATA.
|
|
EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("ns.example.com.")));
|
|
EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("ns.example.com.")));
|
|
// should be case sensitive.
|
|
// should be case sensitive.
|
|
- EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("NS.EXAMPLE.COM")));
|
|
|
|
|
|
+ EXPECT_EQ(0, rdata_ptr.compare(generic::PTR("NS.EXAMPLE.COM.")));
|
|
// RDATA of a class-independent type should be recognized for any
|
|
// RDATA of a class-independent type should be recognized for any
|
|
// "unknown" class.
|
|
// "unknown" class.
|
|
EXPECT_EQ(0, rdata_ptr.compare(*createRdata(RRType("PTR"), RRClass(65000),
|
|
EXPECT_EQ(0, rdata_ptr.compare(*createRdata(RRType("PTR"), RRClass(65000),
|
|
- "ns.example.com")));
|
|
|
|
|
|
+ "ns.example.com.")));
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(Rdata_PTR_Test, createFromWire) {
|
|
TEST_F(Rdata_PTR_Test, createFromWire) {
|
|
@@ -82,7 +82,7 @@ TEST_F(Rdata_PTR_Test, createFromWire) {
|
|
"rdata_ns_fromWire", 71),
|
|
"rdata_ns_fromWire", 71),
|
|
DNSMessageFORMERR);
|
|
DNSMessageFORMERR);
|
|
|
|
|
|
- EXPECT_EQ(0, generic::PTR("ns2.example.com").compare(
|
|
|
|
|
|
+ EXPECT_EQ(0, generic::PTR("ns2.example.com.").compare(
|
|
*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
|
|
*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
|
|
"rdata_ns_fromWire", 55)));
|
|
"rdata_ns_fromWire", 55)));
|
|
EXPECT_THROW(*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
|
|
EXPECT_THROW(*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
|
|
@@ -119,8 +119,8 @@ TEST_F(Rdata_PTR_Test, toText) {
|
|
}
|
|
}
|
|
|
|
|
|
TEST_F(Rdata_PTR_Test, compare) {
|
|
TEST_F(Rdata_PTR_Test, compare) {
|
|
- generic::PTR small("a.example");
|
|
|
|
- generic::PTR large("example");
|
|
|
|
|
|
+ generic::PTR small("a.example.");
|
|
|
|
+ generic::PTR large("example.");
|
|
EXPECT_TRUE(Name("a.example") > Name("example"));
|
|
EXPECT_TRUE(Name("a.example") > Name("example"));
|
|
EXPECT_GT(0, small.compare(large));
|
|
EXPECT_GT(0, small.compare(large));
|
|
}
|
|
}
|