summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJINMEI Tatuya <jinmei@isc.org>2013-03-28 22:54:05 +0100
committerJINMEI Tatuya <jinmei@isc.org>2013-03-28 22:54:05 +0100
commitedd462bc9e8f727b1ebdf14b3f7cb6c844dee35a (patch)
treee08118d497129f6628798f3a9b67d24ad78dc36a
parent[2387] Unify code from MX constructors (diff)
downloadkea-edd462bc9e8f727b1ebdf14b3f7cb6c844dee35a.tar.xz
kea-edd462bc9e8f727b1ebdf14b3f7cb6c844dee35a.zip
[2387] added toWireBuffer tests for DNSKEY and NSEC3PARAM.
not in the scope of this ticket, but should be easy enough.
-rw-r--r--src/lib/dns/tests/rdata_dnskey_unittest.cc7
-rw-r--r--src/lib/dns/tests/rdata_nsec3param_unittest.cc6
2 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/dns/tests/rdata_dnskey_unittest.cc b/src/lib/dns/tests/rdata_dnskey_unittest.cc
index d483d312d6..450c0edb0e 100644
--- a/src/lib/dns/tests/rdata_dnskey_unittest.cc
+++ b/src/lib/dns/tests/rdata_dnskey_unittest.cc
@@ -144,7 +144,12 @@ TEST_F(Rdata_DNSKEY_Test, toWireRenderer) {
TEST_F(Rdata_DNSKEY_Test, toWireBuffer) {
rdata_dnskey.toWire(obuffer);
- // FIXME: Test something here???
+
+ vector<unsigned char> data;
+ UnitTestUtil::readWireData("rdata_dnskey_fromWire", data);
+ EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
+ obuffer.getData(), obuffer.getLength(),
+ &data[2], data.size() - 2);
}
TEST_F(Rdata_DNSKEY_Test, createFromWire) {
diff --git a/src/lib/dns/tests/rdata_nsec3param_unittest.cc b/src/lib/dns/tests/rdata_nsec3param_unittest.cc
index 9752a3c25a..2ca5c1e3b5 100644
--- a/src/lib/dns/tests/rdata_nsec3param_unittest.cc
+++ b/src/lib/dns/tests/rdata_nsec3param_unittest.cc
@@ -167,6 +167,12 @@ TEST_F(Rdata_NSEC3PARAM_Test, toWireRenderer) {
TEST_F(Rdata_NSEC3PARAM_Test, toWireBuffer) {
rdata_nsec3param.toWire(obuffer);
+
+ vector<unsigned char> data;
+ UnitTestUtil::readWireData("rdata_nsec3param_fromWire1", data);
+ EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
+ obuffer.getData(), obuffer.getLength(),
+ &data[2], data.size() - 2);
}
TEST_F(Rdata_NSEC3PARAM_Test, getHashAlg) {