Browse Source

[master] Corrected dhcp_ddns::WatchSocket unit test failure

Unit test was failing as a closed fd passed to select() does not fail
on all OSs.  Changed the test so it verifies that the fd in question
no longer evaluates to ready to ready.
Thomas Markwalder 11 years ago
parent
commit
0053becdd7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/lib/dhcp_ddns/tests/watch_socket_unittests.cc

+ 2 - 2
src/lib/dhcp_ddns/tests/watch_socket_unittests.cc

@@ -194,8 +194,8 @@ TEST(WatchSocketTest, badReadOnClear) {
     /// @todo maybe clear should never throw, log only
     ASSERT_THROW(watch->clearReady(), WatchSocketError);
 
-    // Verify the select_fd fails as socket is invalid/closed.
-    EXPECT_EQ(-1, selectCheck(select_fd));
+    // Verify the select_fd does not evalute to ready.
+    EXPECT_NE(1, selectCheck(select_fd));
 
     // Verify that getSelectFd() returns INVALID.
     ASSERT_EQ(WatchSocket::INVALID_SOCKET, watch->getSelectFd());