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

fixed a failing test case with correct data (tested code was correct,

but test data wasn't)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1468 e5f2f494-b856-4b98-b285-d166d9295462
parent 570bd767
......@@ -36,25 +36,21 @@ class Rdata_SOA_Test : public RdataTest {
// there's nothing to specialize
};
const generic::SOA rdata_soa(Name("ns.example.com"),
Name("root.example.com"),
const generic::SOA rdata_soa(Name("ns.example.com"), Name("root.example.com"),
2010012601, 3600, 300, 3600000, 1200);
TEST_F(Rdata_SOA_Test, createFromText)
{
TEST_F(Rdata_SOA_Test, createFromText) {
//TBD
}
TEST_F(Rdata_SOA_Test, createFromWire)
{
TEST_F(Rdata_SOA_Test, createFromWire) {
EXPECT_EQ(0, rdata_soa.compare(
*rdataFactoryFromFile(RRType("SOA"), RRClass("IN"),
"testdata/rdata_soa_fromWire")));
// TBD: more tests
}
TEST_F(Rdata_SOA_Test, toWireRenderer)
{
TEST_F(Rdata_SOA_Test, toWireRenderer) {
renderer.skip(2);
rdata_soa.toWire(renderer);
......@@ -65,23 +61,17 @@ TEST_F(Rdata_SOA_Test, toWireRenderer)
obuffer.getLength() - 2, &data[2], data.size() - 2);
}
TEST_F(Rdata_SOA_Test, toWireBuffer)
{
TEST_F(Rdata_SOA_Test, toWireBuffer) {
obuffer.skip(2);
rdata_soa.toWire(obuffer);
vector<unsigned char> data;
UnitTestUtil::readWireData("testdata/rdata_soa_fromWire", data);
#if 0
// XXX: this currently fails with a mismatch at byte 21. I'm not sure
// whether it's a test error or a problem with the toWire() method
UnitTestUtil::readWireData("testdata/rdata_soa_toWireUncompressed", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
#endif
}
TEST_F(Rdata_SOA_Test, toText)
{
TEST_F(Rdata_SOA_Test, toText) {
EXPECT_EQ("ns.example.com. root.example.com. "
"2010012601 3600 300 3600000 1200", rdata_soa.toText());
}
......
###
### This data file was auto-generated from rdata_soa_toWireUncompressed.spec
###
# SOA RDATA (RDLEN=54)
0036
# NNAME=ns.example.com RNAME=root.example.com
026e73076578616d706c6503636f6d00 04726f6f74076578616d706c6503636f6d00
# SERIAL(2010012601) REFRESH(3600) RETRY(300) EXPIRE(3600000) MINIMUM(1200)
77ce5bb9 00000e10 0000012c 0036ee80 000004b0
#
# A simple SOA RDATA without name compression
#
[custom]
sections: soa
[soa]
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