]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1924] Merge remote-tracking branch 'origin/trac1914' into trac1924
authorJINMEI Tatuya <jinmei@isc.org>
Thu, 7 Feb 2013 19:25:13 +0000 (11:25 -0800)
committerJINMEI Tatuya <jinmei@isc.org>
Thu, 7 Feb 2013 19:25:13 +0000 (11:25 -0800)
fixed Conflicts:
src/lib/cc/tests/session_unittests.cc

1  2 
src/lib/cc/session.h
src/lib/cc/tests/session_unittests.cc

Simple merge
index 93392f06a5d96bc17edd804814def0a562b1137e,8859bfb03bf55a268877c6b4f7158efa39be25cd..939549c0711092114da4c072048f6a6d981e5b56
@@@ -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);
      }