|
@@ -23,6 +23,12 @@
|
|
|
|
|
|
#include <testutils/dnsmessage_test.h>
|
|
|
|
|
|
+#include <boost/bind.hpp>
|
|
|
+
|
|
|
+#include <string>
|
|
|
+#include <sstream>
|
|
|
+
|
|
|
+using namespace std;
|
|
|
using namespace isc::dns;
|
|
|
|
|
|
namespace isc {
|
|
@@ -82,6 +88,26 @@ matchRdata(const char*, const char*,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// TODO: maybe we should share this stuff
|
|
|
+// A helper callback of masterLoad() used in InMemoryZoneFinderTest.
|
|
|
+void
|
|
|
+setRRset(RRsetPtr rrset, RRsetPtr* rrsetp) {
|
|
|
+ if (*rrsetp) {
|
|
|
+ isc_throw(isc::Unexpected,
|
|
|
+ "multiple RRsets are given to textToRRset");
|
|
|
+ }
|
|
|
+ *rrsetp = rrset;
|
|
|
+}
|
|
|
+
|
|
|
+RRsetPtr
|
|
|
+textToRRset(const string& text_rrset, const RRClass& rrclass) {
|
|
|
+ stringstream ss(text_rrset);
|
|
|
+ RRsetPtr rrset;
|
|
|
+ masterLoad(ss, Name::ROOT_NAME(), rrclass,
|
|
|
+ boost::bind(setRRset, _1, &rrset));
|
|
|
+ return (rrset);
|
|
|
+}
|
|
|
+
|
|
|
void
|
|
|
rrsetCheck(isc::dns::ConstRRsetPtr expected_rrset,
|
|
|
isc::dns::ConstRRsetPtr actual_rrset)
|