Browse Source

[1605] Get all tests (apart from RRSIG-related tests) working

Stephen Morris 13 years ago
parent
commit
bcf5e63536

+ 17 - 22
src/lib/datasrc/rbnode_rrset.h

@@ -67,8 +67,7 @@ public:
     /// \brief Usual Constructor
     ///
     /// Creates an RBNodeRRset from the pointer to the RRset passed to it.
-    RBNodeRRset(const isc::dns::ConstRRsetPtr& rrset) : rrset_(rrset),
-        n("a.com"), c("HS"), t("A"), ttl(0) {}
+    RBNodeRRset(const isc::dns::ConstRRsetPtr& rrset) : rrset_(rrset) {}
 
     /// \brief Destructor
     virtual ~RBNodeRRset() {}
@@ -80,55 +79,56 @@ public:
     // object does not expect the underlying RRset to be modified.
 
     virtual unsigned int getRdataCount() const {
-        return (0);
+        return (rrset_->getRdataCount());
     }
 
     virtual const isc::dns::Name& getName() const {
-        return (n);
+        return (rrset_->getName());
     }
 
     virtual const isc::dns::RRClass& getClass() const {
-        return (c);
+        return (rrset_->getClass());
     }
 
     virtual const isc::dns::RRType& getType() const {
-        return (t);
+        return (rrset_->getType());
     }
 
     virtual const isc::dns::RRTTL& getTTL() const {
-        return (ttl);
+        return (rrset_->getTTL());
     }
 
     virtual void setName(const isc::dns::Name&) {
+        isc_throw(isc::NotImplemented, "RBNodeRRset::setName() not supported");
     }
 
     virtual void setTTL(const isc::dns::RRTTL&) {
+        isc_throw(isc::NotImplemented, "RBNodeRRset::setTTL() not supported");
     }
 
     virtual std::string toText() const {
-        return (std::string());
+        return (rrset_->toText());
     }
 
-    virtual unsigned int toWire(isc::dns::AbstractMessageRenderer& /*renderer*/) const {
-        return (-1);
+    virtual unsigned int toWire(
+            isc::dns::AbstractMessageRenderer& renderer) const {
+        return (rrset_->toWire(renderer));
     }
 
-    virtual unsigned int toWire(isc::util::OutputBuffer& /*buffer*/) const {
-        return (-1);
+    virtual unsigned int toWire(isc::util::OutputBuffer& buffer) const {
+        return (rrset_->toWire(buffer));
     }
 
     virtual void addRdata(isc::dns::rdata::ConstRdataPtr) {
+        isc_throw(isc::NotImplemented, "RBNodeRRset::addRdata() not supported");
     }
 
     virtual void addRdata(const isc::dns::rdata::Rdata&) {
+        isc_throw(isc::NotImplemented, "RBNodeRRset::addRdata() not supported");
     }
 
     virtual isc::dns::RdataIteratorPtr getRdataIterator() const {
-        isc::dns::BasicRRset b(isc::dns::Name("example.com"),
-                               isc::dns::RRClass("IN"),
-                               isc::dns::RRType("A"),
-                               isc::dns::RRTTL(1));
-        return (b.getRdataIterator());
+        return (rrset_->getRdataIterator());
     }
 
     virtual isc::dns::RRsetPtr getRRsig() const {
@@ -160,11 +160,6 @@ public:
 
 private:
     isc::dns::ConstRRsetPtr rrset_;     ///< Underlying RRset
-
-    isc::dns::Name n;
-    isc::dns::RRClass c;
-    isc::dns::RRType t;
-    isc::dns::RRTTL ttl;
 };
 
 }   // namespace datasrc

+ 0 - 3
src/lib/datasrc/tests/rbnode_rrset_unittest.cc

@@ -125,10 +125,7 @@ TEST_F(RBNodeRRsetTest, toText) {
 }
 
 TEST_F(RBNodeRRsetTest, toWireRenderer) {
-    rrset_ns.addRdata(generic::NS(test_nsname));
-
     rrset_a.toWire(renderer);
-    rrset_ns.toWire(renderer);
 
     UnitTestUtil::readWireData("rrset_toWire2", wiredata);
     EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, buffer.getData(),

+ 0 - 12
src/lib/datasrc/tests/testdata/rrset_toWire2

@@ -24,15 +24,3 @@ c0 00
 00 00 0e 10
 00 04
 c0 00 02 02
-# 3rd RR: the owner name and NS name are compressed
-# pointing to the 5th octet of the owner name of the 1st RR
-c0 05
-# type/class: NS = 2, IN = 1
-00 02 00 01
-# TTL: 1D = 86400sec = 0x15180
-00 01 51 80
-# RDLENGTH: 5 octets
-00 05
-# NSDNAME: "ns." + compression pointer
-#(2) n  s
- 02 6e 73 c0 05