List:Commits« Previous MessageNext Message »
From:andrey.hristov Date:October 17 2008 5:33pm
Subject:bzr commit into connector-cpp-bzr branch (andrey.hristov:185)
View as plain text  
#At bzr+ssh://ahristov@stripped/bzrroot/public/connector-cpp-bzr/trunk/

  185 andrey.hristov@stripped	2008-10-17 [merge]
      Merge
modified:
  common/ccppTypes.h
  test/driver_test.cpp
  test/test_common.cpp

=== modified file 'common/ccppTypes.h'
--- a/common/ccppTypes.h	2008-10-17 10:11:08 +0000
+++ b/common/ccppTypes.h	2008-10-17 14:43:14 +0000
@@ -7,7 +7,10 @@
 #define __C_CPP_TYPES_H_
 
 #if defined(_WIN32) || defined(_WIN64)
+/* MySQL 5.1 might have defined it before in include/config-win.h */
+#ifndef strncasecmp
 #define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
+#endif
 #ifndef atoll
 #define atoll(x) _atoi64((x))
 #endif
@@ -25,7 +28,7 @@
 
 /*----------------------------------------------------------------------------
 ci_char_traits : Case-insensitive char traits.
-Taken from : http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/gotw29a.txt 
+Taken from : http://gcc.gnu.org/onlinedocs/libstdc++/21_strings/gotw29a.txt
 and adapted as template for both 'char' and 'wchar_t' types.
 ----------------------------------------------------------------------------*/
 template <typename charT> struct ci_char_traits

=== modified file 'test/driver_test.cpp'
--- a/test/driver_test.cpp	2008-10-15 17:22:12 +0000
+++ b/test/driver_test.cpp	2008-10-17 14:19:07 +0000
@@ -29,6 +29,9 @@
 #include <cppconn/metadata.h>
 
 #include <string>
+#include <iostream>
+
+using namespace std;
 
 int loops = 0;
 
@@ -44,7 +47,8 @@ get_connection(const std::string & host,
 		}
 		return mysql_driver->connect(host, user, pass);
 	} catch (sql::SQLException *e) {
-		printf("sql::SQLException caught during connect\n");
+		cout << "sql::SQLException caught during connect" << endl;
+		cout << e->what() << endl;
 		throw;
 	}
 }

=== modified file 'test/test_common.cpp'
--- a/test/test_common.cpp	2008-10-15 17:22:12 +0000
+++ b/test/test_common.cpp	2008-10-17 14:13:21 +0000
@@ -23,6 +23,19 @@
 #include <map>
 #include <memory>
 
+// Portable __FUNCTION__
+#ifndef __FUNCTION__
+ #ifdef __func__
+   #define __FUNCTION__ __func__
+ #else
+   #define __FUNCTION__ "(function n/a)"
+ #endif
+#endif
+
+#ifndef __LINE__
+  #define __LINE__ "(line number n/a)"
+#endif
+
 #define ensure(msg, stmt)				do {total_tests++;if(!(stmt)){printf("\nError! line=%d:
%s\n",__LINE__,msg);total_errors++;throw new sql::SQLException(CPPCONN_FUNC,
__LINE__,"error");} else { printf(".");}} while (0)
 #define ensure_equal(msg, op1, op2)	do {total_tests++;if((op1)!=(op2)){printf("\nError!
line=%d: %s\n",__LINE__,msg);total_errors++;throw new sql::SQLException(CPPCONN_FUNC,
__LINE__, "error");} else { printf(".");}}while(0)
 #define ensure_equal_int(msg, op1, op2)	do
{total_tests++;if((op1)!=(op2)){printf("\nError! line=%d: %s Op1=%d
Op2=%d\n",__LINE__,msg,op1,op2);total_errors++;throw new sql::SQLException(CPPCONN_FUNC,
__LINE__, "error");} else { printf(".");}}while(0)

Thread
bzr commit into connector-cpp-bzr branch (andrey.hristov:185) andrey.hristov17 Oct