myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [3071] All recent changes now compile under WIN32.


From: Giuseppe Scrivano
Subject: [myserver-commit] [3071] All recent changes now compile under WIN32.
Date: Sun, 03 May 2009 14:06:46 +0000

Revision: 3071
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3071
Author:   gscrivano
Date:     2009-05-03 14:06:45 +0000 (Sun, 03 May 2009)
Log Message:
-----------
All recent changes now compile under WIN32.

Modified Paths:
--------------
    trunk/myserver/tests/test_socket.cpp
    trunk/myserver/tests/test_ssl_socket.cpp

Modified: trunk/myserver/tests/test_socket.cpp
===================================================================
--- trunk/myserver/tests/test_socket.cpp        2009-05-03 12:27:20 UTC (rev 
3070)
+++ trunk/myserver/tests/test_socket.cpp        2009-05-03 14:06:45 UTC (rev 
3071)
@@ -23,14 +23,26 @@
 #include "../include/base/socket/socket.h"
 #include "../include/base/thread/thread.h"
 
+extern "C"
+{
 #include <string.h>
 #include <errno.h>
+
+#ifndef WIN32
 #include <arpa/inet.h>
+#endif
+
 #include <iostream>
+}
 
 using namespace std;
 
-void* testRecvClient ( void* );
+#ifdef WIN32
+unsigned int  __stdcall
+#else
+void *
+#endif
+testRecvClient ( void* );
 
 class TestSocket : public CppUnit::TestFixture
 {
@@ -102,7 +114,7 @@
     
     CPPUNIT_ASSERT( obj->listen ( 1 ) != -1 );
     
-    CPPUNIT_ASSERT_EQUAL( Thread::create ( &tid, testRecvClient, &port ), 0 );
+    CPPUNIT_ASSERT (!Thread::create (&tid, testRecvClient, &port ));
     
     Socket s = obj->accept ( &sockIn, &sockInLen );
     
@@ -159,7 +171,11 @@
 
 CPPUNIT_TEST_SUITE_REGISTRATION( TestSocket );
 
-void*
+#ifdef WIN32
+unsigned int  __stdcall
+#else
+void *
+#endif
 testRecvClient ( void *arg )
 {
   Socket *obj2 = new Socket;
@@ -180,8 +196,6 @@
   
   CPPUNIT_ASSERT( obj2->send ( buf, strlen ( buf ), 0 ) != -1 );
   
-  sleep ( 2 );
-  
   CPPUNIT_ASSERT( obj2->shutdown ( SD_BOTH ) != -1 );
  
   CPPUNIT_ASSERT( obj2->close ( ) != -1 );

Modified: trunk/myserver/tests/test_ssl_socket.cpp
===================================================================
--- trunk/myserver/tests/test_ssl_socket.cpp    2009-05-03 12:27:20 UTC (rev 
3070)
+++ trunk/myserver/tests/test_ssl_socket.cpp    2009-05-03 14:06:45 UTC (rev 
3071)
@@ -28,11 +28,17 @@
 #include "../include/base/file/files_utility.h"
 #include "../include/base/thread/thread.h"
 
+extern "C"
+{
 #include <string.h>
 #include <errno.h>
+
+#ifndef WIN32
 #include <arpa/inet.h>
+#endif
+
 #include <iostream>
-
+}
 using namespace std;
 
 
@@ -83,9 +89,13 @@
 -----END CERTIFICATE-----\n";
 
 
+#ifdef WIN32
+unsigned int  __stdcall
+#else
+void *
+#endif
+testSslRecvClient ( void* ); //
 
-void* testSslRecvClient ( void* ); //
-
 class TestSslSocket : public CppUnit::TestFixture
 {
   CPPUNIT_TEST_SUITE( TestSslSocket );
@@ -201,7 +211,11 @@
 
 CPPUNIT_TEST_SUITE_REGISTRATION( TestSslSocket );
 
-void*
+#ifdef WIN32
+unsigned int  __stdcall
+#else
+void *
+#endif
 testSslRecvClient ( void *arg )
 {
   Socket *obj2 = new Socket;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]