summaryrefslogtreecommitdiffstats
path: root/src/lib/dns/tests/rdata_mx_unittest.cc
diff options
context:
space:
mode:
authorMukund Sivaraman <muks@isc.org>2012-11-29 23:41:14 +0100
committerMukund Sivaraman <muks@isc.org>2012-11-29 23:42:36 +0100
commit022d3888199e59b7a4bc256eaaf188a64db61cdf (patch)
treea3a086e2db0d6b13da5d28b9f2d0f749ebde86b4 /src/lib/dns/tests/rdata_mx_unittest.cc
parent[2497] Move create() definition to .cc file (diff)
downloadkea-022d3888199e59b7a4bc256eaaf188a64db61cdf.tar.xz
kea-022d3888199e59b7a4bc256eaaf188a64db61cdf.zip
[2497] Add rdata::createRdata() and tests for some RRtypes
Diffstat (limited to 'src/lib/dns/tests/rdata_mx_unittest.cc')
-rw-r--r--src/lib/dns/tests/rdata_mx_unittest.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/dns/tests/rdata_mx_unittest.cc b/src/lib/dns/tests/rdata_mx_unittest.cc
index 7dc774d770..4747138eae 100644
--- a/src/lib/dns/tests/rdata_mx_unittest.cc
+++ b/src/lib/dns/tests/rdata_mx_unittest.cc
@@ -62,6 +62,17 @@ TEST_F(Rdata_MX_Test, createFromWire) {
// TBD: more tests
}
+TEST_F(Rdata_MX_Test, createFromLexer) {
+ EXPECT_EQ(0, rdata_mx.compare(
+ *test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
+ "10 mx.example.com")));
+
+ EXPECT_THROW({
+ test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
+ "10 mx. example.com");
+ }, InvalidRdataText);
+}
+
TEST_F(Rdata_MX_Test, toWireRenderer) {
renderer.writeName(Name("example.com"));
rdata_mx.toWire(renderer);