Commit 8430ef5f authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

define TestDataSrc::init() to avoid initialization ordering problems

for some non local objects


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1128 e5f2f494-b856-4b98-b285-d166d9295462
parent 73ed7724
......@@ -45,8 +45,9 @@ TestDataSrc ds;
class DataSrcTest : public ::testing::Test {
protected:
DataSrcTest() : obuffer(0), renderer(obuffer), msg(Message::PARSE)
{}
DataSrcTest() : obuffer(0), renderer(obuffer), msg(Message::PARSE) {
ds.init();
}
OutputBuffer obuffer;
MessageRenderer renderer;
Message msg;
......
......@@ -95,7 +95,12 @@ RRsetPtr loop1_cname;
RRsetPtr loop2_cname;
}
TestDataSrc::TestDataSrc() {
DataSrc::Result
TestDataSrc::init() {
if (initialized) {
return (SUCCESS);
}
RRset* rp;
RRsetPtr rrsig;
......@@ -403,6 +408,9 @@ TestDataSrc::TestDataSrc() {
loop2_cname = RRsetPtr(new RRset(loop2, RRClass::IN(), RRType::CNAME(),
RRTTL(3600)));
loop2_cname->addRdata(generic::CNAME(loop1));
initialized = true;
return (SUCCESS);
}
void
......
......@@ -44,7 +44,7 @@ private:
TestDataSrc(const TestDataSrc& source);
TestDataSrc operator=(const TestDataSrc& source);
public:
TestDataSrc();
TestDataSrc() : initialized(false) {}
~TestDataSrc() {}
//@}
......@@ -91,10 +91,11 @@ public:
const isc::dns::Name& zonename,
isc::dns::RRsetList& target) const;
Result init() { return (SUCCESS); }
Result init();
Result close() { return (SUCCESS); }
private:
bool initialized;
enum Mode {
NORMAL,
ADDRESS,
......
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