]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1914] Fix tests
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 17 May 2012 15:26:59 +0000 (17:26 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 17 May 2012 15:26:59 +0000 (17:26 +0200)
The fake session didn't want to support hasQueuedMessages properly.
Also, we need to be subscribed to the correct group to actually get the
messages through the session.

src/lib/config/tests/ccsession_unittests.cc
src/lib/config/tests/fake_session.cc

index 423873120bb53f5243abba2e4618a9522cb9d537..2cc6a37751681b9bc2576febdf770a8d589a310c 100644 (file)
@@ -722,7 +722,12 @@ protected:
     AsyncReceiveCCSessionTest() :
         mccs_(ccspecfile("spec29.spec"), session, NULL, NULL, false, false),
         next_flag_(0)
-    {}
+    {
+        // This is just to make sure the messages get through the fake
+        // session.
+        session.subscribe("test group");
+        session.subscribe("<ignored>");
+    }
     /// \brief Convenience function to queue a request to get a command
     ///     message.
     ModuleCCSession::AsyncRecvRequestID
index bf4471dade6c34b00ab61806352b93fd0a251805..65e12cdbe73e60532c7cbabed569eb48cb0536e2 100644 (file)
@@ -207,7 +207,7 @@ FakeSession::reply(ConstElementPtr envelope, ConstElementPtr newmsg) {
 
 bool
 FakeSession::hasQueuedMsgs() const {
-    return (false);
+    return (messages_ && messages_->size() > 0);
 }
 
 ConstElementPtr