List:Commits« Previous MessageNext Message »
From:pharvey Date:February 28 2006 3:14am
Subject:Connector/ODBC 3.51 commit: r36 - / test test/basics test/connect test/include test/test32
View as plain text  
Added:
   test/test32/test32.pro
Modified:
   CreateBinaryMsi.bat
   PostBuildTest.bat
   test/basics/my_basics.c
   test/connect/my_connect.c
   test/include/mytest3.h
   test/test.pro
   test/test.vpj
Log:
start to improve post-build/smoke tests

Modified: CreateBinaryMsi.bat
===================================================================
--- CreateBinaryMsi.bat	2006-02-23 18:17:44 UTC (rev 35)
+++ CreateBinaryMsi.bat	2006-02-28 03:14:41 UTC (rev 36)
@@ -37,6 +37,7 @@
 REM Creating Commercial msi...
 cd ..\wix-installer
 copy bin\mysql-connector-odbc-%1-win32\Windows\System32\LICENSE.commercial
bin\mysql-connector-odbc-%1-win32\Windows\System32\myodbc3-license.rtf
+copy bin\mysql-connector-odbc-%1-win32\Windows\System32\LICENSE.commercial
resources\commercial_license.rtf
 call OdbcMakeSetup.bat %1 %2 commercial
 
 REM Creating GPL msi...

Modified: PostBuildTest.bat
===================================================================
--- PostBuildTest.bat	2006-02-23 18:17:44 UTC (rev 35)
+++ PostBuildTest.bat	2006-02-28 03:14:41 UTC (rev 36)
@@ -44,6 +44,7 @@
 test\bin\tran_ext.exe %1 %2 %3
 test\bin\use_result.exe 10000 %1 %2 %3
 test\bin\catalog.exe %1 %2 %3
+test\bin\test32.exe %1 %2 %3
 
 ECHO END: Post build test.
 

Modified: test/basics/my_basics.c
===================================================================
--- test/basics/my_basics.c	2006-02-23 18:17:44 UTC (rev 35)
+++ test/basics/my_basics.c	2006-02-28 03:14:41 UTC (rev 36)
@@ -29,10 +29,10 @@
 *********************************************************/
 void my_basics(SQLHDBC hdbc, SQLHSTMT hstmt)
 {
-  SQLRETURN  rc;
-  SQLINTEGER nRowCount;
+    SQLRETURN  rc;
+    SQLINTEGER nRowCount;
 
-  printf("\nmy_basics:\n");
+    printf("\nmy_basics:\n");
 
     /* drop table 'myodbc3_demo_basic' if it already exists */
     rc = SQLExecDirect(hstmt,"DROP TABLE if exists myodbc3_demo_basic",SQL_NTS);
@@ -55,11 +55,11 @@
     rc = SQLExecDirect(hstmt,"INSERT INTO myodbc3_demo_basic values(\
                               1,'MySQL')",SQL_NTS);
     mystmt(hstmt,rc);
-    
+
     rc = SQLExecDirect(hstmt,"INSERT INTO myodbc3_demo_basic values(\
                               2,'MyODBC')",SQL_NTS);
     mystmt(hstmt,rc);
-    
+
     rc = SQLExecDirect(hstmt,"INSERT INTO myodbc3_demo_basic values(\
                               3,'monty')",SQL_NTS);
     mystmt(hstmt,rc);
@@ -128,30 +128,26 @@
 *********************************************************/
 int main(int argc, char *argv[])
 {
-  SQLHENV    henv;
-  SQLHDBC    hdbc; 
-  SQLHSTMT   hstmt;
-  SQLINTEGER narg;
-  
-    /*
-     *  show the usage string when the user asks for this
-    */    
-      printf("***********************************************\n");
-      printf("usage: my_basics [DSN] [UID] [PWD] \n");  
-      printf("***********************************************\n");          
+    SQLHENV    henv;
+    SQLHDBC    hdbc; 
+    SQLHSTMT   hstmt;
+    SQLINTEGER narg;
 
+
+    printMessageHeader();
+
     /*
      * if connection string supplied through arguments, overrite
      * the default one..
     */
-    for(narg = 1; narg < argc; narg++)
-    {     
-      if ( narg == 1 )
-        mydsn = argv[1];
-      else if ( narg == 2 )
-        myuid = argv[2];
-      else if ( narg == 3 )
-        mypwd = argv[3];      
+    for (narg = 1; narg < argc; narg++)
+    {
+        if ( narg == 1 )
+            mydsn = argv[1];
+        else if ( narg == 2 )
+            myuid = argv[2];
+        else if ( narg == 3 )
+            mypwd = argv[3];
     }   
 
     /* 
@@ -169,7 +165,9 @@
     */
     mydisconnect(&henv,&hdbc,&hstmt);
 
-  return(0);
+    printMessageFooter();
+
+    return(0);
 } 
 
 

Modified: test/connect/my_connect.c
===================================================================
--- test/connect/my_connect.c	2006-02-23 18:17:44 UTC (rev 35)
+++ test/connect/my_connect.c	2006-02-28 03:14:41 UTC (rev 36)
@@ -29,73 +29,75 @@
 *********************************************************/
 int main(int argc, char *argv[])
 {
-  SQLHENV    henv;
-  SQLHDBC    hdbc; 
-  SQLCHAR    server_name[30];  
-  SQLRETURN  rc;
-  SQLINTEGER narg;
-  
-    /*
-     *  show the usage string when the user asks for this
-    */    
-      printf("***********************************************\n");
-      printf("usage: my_connect [DSN] [UID] [PWD] \n");  
-      printf("***********************************************\n");     
+    SQLHENV    henv;
+    SQLHDBC    hdbc; 
+    SQLCHAR    server_name[30];  
+    SQLRETURN  rc;
+    SQLINTEGER narg;
 
+    printMessageHeader();
+
     /*
      * if connection string supplied through arguments, overrite
      * the default one..
     */
-    for(narg = 1; narg < argc; narg++)
-    {     
-      if ( narg == 1 )
-        mydsn = argv[1];
-      else if ( narg == 2 )
-        myuid = argv[2];
-      else if ( narg == 3 )
-        mypwd = argv[3];      
-          
+    for (narg = 1; narg < argc; narg++)
+    {
+        if ( narg == 1 )
+            mydsn = argv[1];
+        else if ( narg == 2 )
+            myuid = argv[2];
+        else if ( narg == 3 )
+            mypwd = argv[3];
+
     }   
-    
-    printf("\n allocating environment handle ...");
 
+    printMessageAction( "Allocate an environment" );
+
     rc = SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&henv);
     myenv(henv, rc);
-    
-    printf("success..\n setting the environment version ...");
 
+    printMessageResult( "SUCCESS" );
+    printMessageAction( "Set the environment version" );
+
     rc = SQLSetEnvAttr(henv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3,0);
     myenv(henv, rc);
 
-    printf("success..\n allocating the connection handle ...");
+    printMessageResult( "SUCCESS" );
+    printMessageAction( "Allocate a connection handle" );
 
     rc = SQLAllocHandle(SQL_HANDLE_DBC,henv, &hdbc);   
     myenv(henv, rc);
-    
-    printf("success..\n connecting to server using DSN '%s'...",mydsn);
 
+    printMessageResult( "SUCCESS" );
+    printMessageAction1( "Connect to server using DSN=%s", mydsn );
+
     rc = SQLConnect(hdbc, mydsn, SQL_NTS, myuid, SQL_NTS,  mypwd, SQL_NTS);
     mycon(hdbc, rc);
-          
-    printf("success..\n");
 
+    printMessageResult( "SUCCESS" );
+    printMessageAction( "Get database name" );
+
     rc = SQLGetInfo(hdbc,SQL_DBMS_NAME,&server_name,40,NULL);
     mycon(hdbc, rc);
 
-    printf(" connection established successfully to server '%s'\n",server_name);
-    
+    printMessageResult1( "SUCCESS (%s)", server_name );
+    printMessageAction( "Clean up" );
+
     rc = SQLDisconnect(hdbc); 
     mycon(hdbc, rc);
-        
+
     rc = SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
     mycon(hdbc, rc);
-      
+
     rc = SQLFreeHandle(SQL_HANDLE_ENV, henv);
     myenv(henv, rc);
 
-  printf("\nSUCCESS ...\n\n");
+    printMessageResult( "SUCCESS" );
 
-  return(0);  
+    printMessageFooter();
+
+    return(0);  
 } 
 
 

Modified: test/include/mytest3.h
===================================================================
--- test/include/mytest3.h	2006-02-23 18:17:44 UTC (rev 35)
+++ test/include/mytest3.h	2006-02-28 03:14:41 UTC (rev 36)
@@ -152,10 +152,33 @@
             myerror(rc, 3, hstmt); \
         my_assert( r )
 
-#define myheader(str) { fprintf(stdout,"\n\n######################################\n"); \
-                        fprintf(stdout,"%s", str); \
-                        fprintf(stdout,"\n######################################\n"); \
-                      }
+#ifdef MY_DEBUG
+    #define printMessageHeader()\
+        fprintf( stdout, "[%s][%d] BEGIN", __FILE__, __LINE__ );
+    
+    #define printMessageFooter()\
+        fprintf( stdout, "[%s][%d] END", __FILE__, __LINE__ );
+    
+    #define printMessageAction( A )\
+        fprintf( stdout, "[%s][%d] " A, __FILE__, __LINE__ );
+    
+    #define printMessageResult( A )\
+        fprintf( stdout, "...... " A "\n" );
+    
+    #define printMessageAction1( A, B )\
+        fprintf( stdout, "[%s][%d] " A, __FILE__, __LINE__, B );
+    
+    #define printMessageResult1( A, B )\
+        fprintf( stdout, "...... " A "\n", B );
+#else
+    #define printMessageHeader()
+    #define printMessageFooter()
+    #define printMessageAction( A )
+    #define printMessageResult( A )
+    #define printMessageAction1( A, B )
+    #define printMessageResult1( A, B )
+#endif
+
 #define IS_NUM(t) (if
 /**
 ERROR HANDLER

Modified: test/test.pro
===================================================================
--- test/test.pro	2006-02-23 18:17:44 UTC (rev 35)
+++ test/test.pro	2006-02-28 03:14:41 UTC (rev 36)
@@ -20,5 +20,6 @@
                 error \
                 tran_ext \
                 use_result \
-                catalog
+                catalog \
+                test32
 

Modified: test/test.vpj
===================================================================
--- test/test.vpj	2006-02-23 18:17:44 UTC (rev 35)
+++ test/test.vpj	2006-02-28 03:14:41 UTC (rev 36)
@@ -108,6 +108,7 @@
 			<F N="result/result.pro"/>
 			<F N="scroll/scroll.pro"/>
 			<F N="test.pro"/>
+			<F N="test32/test32.pro"/>
 			<F N="timestamp/timestamp.pro"/>
 			<F N="tran/tran.pro"/>
 			<F N="tran_ext/tran_ext.pro"/>

Added: test/test32/test32.pro
===================================================================
--- test/test32/test32.pro	2006-02-23 18:17:44 UTC (rev 35)
+++ test/test32/test32.pro	2006-02-28 03:14:41 UTC (rev 36)
@@ -0,0 +1,32 @@
+# #########################################################
+# COMMON
+# #########################################################
+TEMPLATE	= app
+TARGET		= test32
+DESTDIR		= ../bin
+include( ../../common.pri )
+include( ../../config.pri )
+include( ../../defines.pri )
+include( ../../odbc.pri )
+CONFIG	        += console
+INCLUDEPATH	+= ../../ ../include
+
+# #########################################################
+# WIN32
+# #########################################################
+win32 {
+        DEFINES		-= UNICODE
+        DEFINES		+= Q_WS_WIN
+}
+
+# #########################################################
+# FILES
+# #########################################################
+HEADERS			+= \
+			..\include\my_utility.h \
+			..\include\mytest.h \
+			..\include\mytest3.h
+
+SOURCES			+= \
+			mytest32.c
+

Thread
Connector/ODBC 3.51 commit: r36 - / test test/basics test/connect test/include test/test32pharvey28 Feb