Commit 56de9af8 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2107] add explicit tests for RdataSet::getNext()

parent 4ecc4e32
......@@ -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
......
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