From: JINMEI Tatuya Date: Thu, 7 Feb 2013 19:25:13 +0000 (-0800) Subject: [1924] Merge remote-tracking branch 'origin/trac1914' into trac1924 X-Git-Tag: bind10-1.1.0beta1-release~104^2~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f8ec08cfd2eb7c92041fece5a4e67d48fb822f8;p=thirdparty%2Fkea.git [1924] Merge remote-tracking branch 'origin/trac1914' into trac1924 fixed Conflicts: src/lib/cc/tests/session_unittests.cc --- 7f8ec08cfd2eb7c92041fece5a4e67d48fb822f8 diff --cc src/lib/cc/tests/session_unittests.cc index 93392f06a5,8859bfb03b..939549c071 --- a/src/lib/cc/tests/session_unittests.cc +++ b/src/lib/cc/tests/session_unittests.cc @@@ -191,45 -173,22 +173,22 @@@ protected delete tds; } - void SetUp() { - // There are blocking reads in some tests. We want to have a safety - // catch in case the sender didn't write enough. We set a timeout of - // 10 seconds per one test (which should really be enough even on - // slow machines). If the timeout happens, it kills the test and - // the whole test fails. - //alarm(10); - } - - void TearDown() { - // Cancel the timeout scheduled in SetUp. We don't want to kill any - // of the other tests by it by accident. - alarm(0); - } - // Check two elements are equal - void elementsEqual(const ConstElementPtr& expected, - const ConstElementPtr& actual) const - { - EXPECT_TRUE(expected->equals(*actual)) << - "Elements differ, expected: " << expected->toWire() << - ", got: " << actual->toWire(); - } - - // The same, but with one specified as string void elementsEqual(const string& expected, - const ConstElementPtr& actual) + const ConstElementPtr& actual) const { - const ConstElementPtr expected_el(Element::fromJSON(expected)); - elementsEqual(expected_el, actual); + EXPECT_TRUE(Element::fromJSON(expected)->equals(*actual)) << + "Elements differ, expected: " << expected << + ", got: " << actual->toWire(); } // Check the session sent a message with the given header. The // message is hardcoded. void checkSentMessage(const string& expected_hdr, - const char* description) + const char* description) const { SCOPED_TRACE(description); - const SentMessage msg(tds->readmsg()); + const SentMessage &msg(sess.getSentMessage()); elementsEqual(expected_hdr, msg.first); elementsEqual("{\"test\": 42}", msg.second); }