Date: Thursday, September 21, 2006 @ 10:21:11
Author: gilles
Path: /cvsroot/carob/carob/test
Modified: CarobTestLauncher.cpp (1.33 -> 1.34)
Added windows socket lib initialization code for mingw
-----------------------+
CarobTestLauncher.cpp | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletion(-)
Index: carob/test/CarobTestLauncher.cpp
diff -u carob/test/CarobTestLauncher.cpp:1.33
carob/test/CarobTestLauncher.cpp:1.34
--- carob/test/CarobTestLauncher.cpp:1.33 Thu Jul 27 17:10:42 2006
+++ carob/test/CarobTestLauncher.cpp Thu Sep 21 10:21:11 2006
@@ -61,7 +61,19 @@
// Set up a simple configuration that logs on the console.
log4cxx::BasicConfigurator::configure();
#endif
-
+#ifdef __MINGW32__
+ //init windows socket lib
+ WSADATA WSAData;
+ if (isInfoEnabled())
+ logInfo(L"read_example", L"Initializing windows socket library");
+ if (WSAStartup(MAKEWORD(2,0), &WSAData) != 0)
+ {
+ if (isErrorEnabled())
+ logError(L"read_example", L"Unable to find suitable windows socket
library");
+ throw ConnectionException(L"Unable to find suitable windows socket
library");
+ return false;
+ }
+#endif
// available levels are found in log4cxx documentation
// or in file include/Common.hpp
//setLogLevel(LOG_LEVEL_DEBUG);
@@ -96,6 +108,9 @@
//runner.run("TestBigDecimal");
runner.run();
//Do *NOT* delete CarobProtector, it is done by the ProtectorChain (in pop())
+#ifdef __MINGW32__
+ WSACleanup();
+#endif
return 0;
}
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits