List:Commits« Previous MessageNext Message »
From:sebrecht Date:June 14 2007 5:51pm
Subject:ODBC C-tests commit: r148 - trunk/testsuites/t_bug_union_select
View as plain text  
Modified:
   trunk/testsuites/t_bug_union_select/bug7684.c
Log:
add comparing of the strings


Modified: trunk/testsuites/t_bug_union_select/bug7684.c
===================================================================
--- trunk/testsuites/t_bug_union_select/bug7684.c	2007-06-14 15:38:18 UTC (rev 147)
+++ trunk/testsuites/t_bug_union_select/bug7684.c	2007-06-14 15:51:47 UTC (rev 148)
@@ -21,7 +21,7 @@
   SQLRETURN rc;
   int i= 0;
   SQLHANDLE stmt= get_statement();
-  SQLINTEGER *len = (SQLINTEGER *)malloc(sizeof(SQLINTEGER));
+  SQLLEN len;
   char *qry= "select repeat('a', 1) "
     "union select repeat('b', 10) "
     "union select repeat('c', 4) "
@@ -32,10 +32,17 @@
   for (i= 0; (rc= SQLFetch(stmt)) == SQL_SUCCESS; ++i)
   {
     CHECK_SQL_S(SQLGetData(stmt, 1, SQL_C_CHAR,
-                           rslt[i], STRLEN, &len[i]), stmt);
+                           rslt[i], STRLEN, &len), stmt);
     test_printf("result: %s\n",rslt[i]);
   }
+  free_statement(stmt);
     test_printf("number of rows: %d\n",i);
-    if (i<4) OT_FAIL("the bug is not fixed ...");
-  free_statement(stmt);
+    if (i<4) OT_FAIL("to many rows were found ...");
+    else
+    {
+      if(strcmp(rslt[0],"a") != 0) OT_FAIL("incorrect output");
+      if(strcmp(rslt[1],"bbbbbbbbbb") != 0) OT_FAIL("incorrect output");
+      if(strcmp(rslt[2],"cccc") != 0) OT_FAIL("incorrect output");
+      if(strcmp(rslt[3],"ddd") != 0) OT_FAIL("incorrect output");
+    }
 }

Thread
ODBC C-tests commit: r148 - trunk/testsuites/t_bug_union_selectsebrecht14 Jun