|
@@ -116,6 +116,22 @@ TEST_F(RdataSetTest, create) {
|
|
|
RdataSet::destroy(mem_sgmt_, RRClass::IN(), rdataset);
|
|
|
}
|
|
|
|
|
|
+TEST_F(RdataSetTest, getNext) {
|
|
|
+ RdataSet* rdataset = RdataSet::create(mem_sgmt_, encoder_, a_rrset_,
|
|
|
+ ConstRRsetPtr());
|
|
|
+
|
|
|
+ // By default, the next pointer should be NULL (already tested in other
|
|
|
+ // test cases), which should be the case with getNext()
|
|
|
+ EXPECT_EQ(static_cast<RdataSet*>(NULL), rdataset->getNext());
|
|
|
+
|
|
|
+ // making a link (it would form an infinite loop, but it doesn't matter
|
|
|
+ // in this test), and check the pointer returned by getNext().
|
|
|
+ rdataset->next = rdataset;
|
|
|
+ EXPECT_EQ(rdataset, rdataset->getNext());
|
|
|
+
|
|
|
+ RdataSet::destroy(mem_sgmt_, RRClass::IN(), rdataset);
|
|
|
+}
|
|
|
+
|
|
|
// A helper function to create an RRset containing the given number of
|
|
|
// unique RDATAs.
|
|
|
ConstRRsetPtr
|