I have a fix for failure in testWriteAndAcceptMsg in OsSocketTest.cpp in 
sipxportlibtest.

Only small delay was needed after write and it passes.
I have a dual core 1.83Ghz intel core duo 2 processor which is maybe too fast 
and read is attempted too early before data arrives.
Patch is in attachment.

Jaro
diff -ru old/OsSocketTest.cpp new/OsSocketTest.cpp
--- old/OsSocketTest.cpp	Fri Dec 29 13:51:08 2006
+++ new/OsSocketTest.cpp	Fri Dec 29 13:46:55 2006
@@ -112,6 +112,9 @@
         CPPUNIT_ASSERT_EQUAL_MESSAGE("write correct number of bytes", 
                 bytesWritten, len);
 
+        // wait a bit
+        OsTask::delay(100);
+
         char recvBuf[1024];
         int bytesRead = serverClient->read(recvBuf, sizeof(recvBuf) - 1);
         CPPUNIT_ASSERT_EQUAL_MESSAGE("read correct number of bytes", 
@@ -124,6 +127,9 @@
 
         CPPUNIT_ASSERT_EQUAL_MESSAGE("write correct number of bytes on 2nd msg", 
             len, bytesWritten);
+
+        // wait a bit
+        OsTask::delay(100);
 
         bytesRead = client->read(recvBuf, sizeof(recvBuf) - 1);
         CPPUNIT_ASSERT_EQUAL_MESSAGE("read correct number of bytes on 2nd msg", 
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to