From 6e99f2cb85dd4722f7a5c2d15ebf2458cecc7b32 Mon Sep 17 00:00:00 2001 From: Thomas Markwalder Date: Mon, 1 Jul 2013 08:11:05 -0400 Subject: [2957] Made forward and reverse ddns elements optional, altered clone method to return smart pointer. --- src/bin/d2/tests/d_test_stubs.cc | 4 ++-- src/bin/d2/tests/d_test_stubs.h | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/bin/d2/tests') diff --git a/src/bin/d2/tests/d_test_stubs.cc b/src/bin/d2/tests/d_test_stubs.cc index 5d9077d3f2..4e1cee688d 100644 --- a/src/bin/d2/tests/d_test_stubs.cc +++ b/src/bin/d2/tests/d_test_stubs.cc @@ -260,9 +260,9 @@ DStubContext::getExtraStorage() { return (extra_values_); } -DStubContext* +DCfgContextBasePtr DStubContext::clone() { - return (new DStubContext(*this)); + return (DCfgContextBasePtr(new DStubContext(*this))); } DStubContext::DStubContext(const DStubContext& rhs): DCfgContextBase(rhs), diff --git a/src/bin/d2/tests/d_test_stubs.h b/src/bin/d2/tests/d_test_stubs.h index ec23efea16..0f0084f9ed 100644 --- a/src/bin/d2/tests/d_test_stubs.h +++ b/src/bin/d2/tests/d_test_stubs.h @@ -521,8 +521,8 @@ public: /// @brief Creates a clone of a DStubContext. /// - /// @return returns a raw pointer to the new clone. - virtual DStubContext* clone(); + /// @return returns a pointer to the new clone. + virtual DCfgContextBasePtr clone(); protected: /// @brief Copy constructor @@ -607,10 +607,11 @@ public: try { config_set_ = isc::data::Element::fromJSON(json_text); } catch (...) { - // This is so we can diagnose parsing mistakes during test - // development. - std::cerr << "fromJSON failed to parse text" << json_text + #if 0 + // Handy for diagnostics + std::cout << "fromJSON failed to parse text" << json_text << std::endl; + #endif return (false); } @@ -627,8 +628,8 @@ public: int rcode = 0; isc::data::ConstElementPtr comment; comment = isc::config::parseAnswer(rcode, answer_); + #if 0 // Handy for diagnostics - #if 1 if (rcode != 0) { std::cout << "checkAnswer rcode:" << rcode << " comment: " << *comment << std::endl; -- cgit v1.2.3