Commit e732d557 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

cleanup: use constants RRClasses rather than constructing them from text every time.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1706 e5f2f494-b856-4b98-b285-d166d9295462
parent 886bc05b
......@@ -106,15 +106,15 @@ TEST_F(Rdata_Unknown_Test, createFromText)
{
// valid construction. This also tests a normal case of "FromWire".
EXPECT_EQ(0, generic::Generic("\\# 4 a1b2c30d").compare(
*rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
*rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
"testdata/rdata_unknown_fromWire")));
// upper case hexadecimal digits should also be okay.
EXPECT_EQ(0, generic::Generic("\\# 4 A1B2C30D").compare(
*rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
*rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
"testdata/rdata_unknown_fromWire")));
// 0-length RDATA should be accepted
EXPECT_EQ(0, generic::Generic("\\# 0").compare(
*rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
*rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
"testdata/rdata_unknown_fromWire", 6)));
// hex encoding can be space-separated
EXPECT_EQ(0, generic::Generic("\\# 4 a1 b2c30d").compare(rdata_unknown));
......@@ -153,7 +153,7 @@ TEST_F(Rdata_Unknown_Test, createFromWire)
// normal case (including 0-length data) is covered in createFromText.
// buffer too short. the error should be detected in buffer read
EXPECT_THROW(rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
EXPECT_THROW(rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
"testdata/rdata_unknown_fromWire", 8),
InvalidBufferPosition);
......@@ -170,10 +170,10 @@ TEST_F(Rdata_Unknown_Test, createFromWire)
TEST_F(Rdata_Unknown_Test, createRdataFromString)
{
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("IN"),
*createRdata(unknown_rrtype, RRClass::IN(),
rdata_unknowntxt)));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CH"),
*createRdata(unknown_rrtype, RRClass::CH(),
rdata_unknowntxt)));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CLASS65000"),
......@@ -184,12 +184,12 @@ TEST_F(Rdata_Unknown_Test, createRdataFromWire)
{
InputBuffer ibuffer(wiredata_unknown, sizeof(wiredata_unknown));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("IN"),
*createRdata(unknown_rrtype, RRClass::IN(),
ibuffer, sizeof(wiredata_unknown))));
InputBuffer ibuffer2(wiredata_unknown, sizeof(wiredata_unknown));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CH"),
*createRdata(unknown_rrtype, RRClass::CH(),
ibuffer2, sizeof(wiredata_unknown))));
InputBuffer ibuffer3(wiredata_unknown, sizeof(wiredata_unknown));
......@@ -201,9 +201,9 @@ TEST_F(Rdata_Unknown_Test, createRdataFromWire)
TEST_F(Rdata_Unknown_Test, createRdataByCopy)
{
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("IN"), rdata_unknown)));
*createRdata(unknown_rrtype, RRClass::IN(), rdata_unknown)));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CH"), rdata_unknown)));
*createRdata(unknown_rrtype, RRClass::CH(), rdata_unknown)));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CLASS65000"),
rdata_unknown)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment