Browse Source

[4009] Fixed the failing unit test

Francis Dupont 9 years ago
parent
commit
7814f705c8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/lib/asiolink/tests/tcp_socket_unittest.cc

+ 6 - 0
src/lib/asiolink/tests/tcp_socket_unittest.cc

@@ -464,8 +464,14 @@ TEST(TCPSocket, sequenceTest) {
             }
         }
 
+	// Has the client run?
         if (!client_complete) {
 
+	    if (client_cb.called() != client_cb.queued()) {
+		// No. Run the service another time.
+		continue;
+	    }
+
             // Client callback must have run.  Check that it ran OK.
             EXPECT_EQ(TCPCallback::READ, client_cb.called());
             EXPECT_EQ(0, client_cb.getCode());