Commit 03911f10 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2377] Use rrsetCheck() for comparing RRsets

Comparing their toText() might be unreliable. In theory, the toText()
result could be slightly different even for equal RRsets (if their
background implementation is different) and the test fail.

Include a hack for the rrsetCheck interface being incompatible.
parent 22d72fe8
......@@ -20,6 +20,8 @@
#include <dns/rrttl.h>
#include <dns/rdata.h>
#include <testutils/dnsmessage_test.h>
#include <exceptions/exceptions.h>
#include <gtest/gtest.h>
......@@ -42,7 +44,20 @@ public:
virtual void addRRset(const isc::dns::AbstractRRset& rrset) {
EXPECT_EQ(expected_rrsets_.front().get()->toText(), rrset.toText());
// As the rrsetCheck requires a shared pointer, we need to create
// a copy.
isc::dns::RRsetPtr copy(new isc::dns::BasicRRset(rrset.getName(),
EXPECT_FALSE(rrset.getRRsig()) << "Unexpected RRSIG on rrset, not "
"copying. Following check will likely fail as a result.";
for (isc::dns::RdataIteratorPtr it(rrset.getRdataIterator());
!it->isLast(); it->next()) {
isc::testutils::rrsetCheck(expected_rrsets_.front(), copy);
// And remove this RRset, as it has been used.
Supports Markdown
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