Skip to Content.
Sympa Menu

freetds - ODBC unit test t0004

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Castellano, Nicholas" <Nicholas_Castellano AT acml.com>
  • To: "'freetds AT franklin.oit.unc.edu'" <freetds AT franklin.metalab.unc.edu>
  • Subject: ODBC unit test t0004
  • Date: Fri, 4 Oct 2002 11:10:51 -0400

ODBC unit test t0004 always fails for me ("Data not expected".)

Reading the code for this test, it appears to me that the test itself is
incorrect.

Is the attached patch correct?

Cheers,
--nick


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.




? typescript
? rebuild.sh
? src/apps/dd_table.fmt
? src/apps/dd_table.dat
? src/apps/dd_table_2.dat
? src/dblib/unittests/t0022.c-save
? src/dblib/unittests/typescript
? src/odbc/typescript
? src/odbc/unittests/ktrace.out
Index: src/odbc/unittests/t0004.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/odbc/unittests/t0004.c,v
retrieving revision 1.1
diff -u -u -r1.1 t0004.c
--- src/odbc/unittests/t0004.c 28 Sep 2002 12:47:02 -0000 1.1
+++ src/odbc/unittests/t0004.c 4 Oct 2002 15:08:50 -0000
@@ -12,7 +12,6 @@
Connect();

strcpy(buf,"I don't exist");
- strcpy(buf,"sysobjects");
ind = strlen(buf);

if ( SQLBindParameter(Statement,1,SQL_PARAM_INPUT,SQL_C_CHAR,
@@ -34,6 +33,24 @@

if (SQLFetch(Statement) != SQL_NO_DATA) {
printf("Data not expected\n");
+ exit(1);
+ }
+
+ if (SQLMoreResults(Statement) != SQL_NO_DATA) {
+ printf("Not expected another recordset\n");
+ exit(1);
+ }
+
+ strcpy(buf,"sysobjects");
+ ind = strlen(buf);
+
+ if ( SQLExecute(Statement) != SQL_SUCCESS ) {
+ printf( "Unable to execute statement\n" );
+ exit (1);
+ }
+
+ if (SQLFetch(Statement) == SQL_NO_DATA) {
+ printf("Data expected\n");
exit(1);
}



  • ODBC unit test t0004, Castellano, Nicholas, 10/06/2002

Archive powered by MHonArc 2.6.24.

Top of Page