From 62311bde64744fa4427138a8dc52fcb7a5fc7491 Mon Sep 17 00:00:00 2001 From: Gregory Burd Date: Tue, 1 Sep 2009 09:53:56 -0400 Subject: [PATCH] Fixing the non-SQLite tests, the ones adopted from DB. --- dist/pubdef.in | 0 docs_src/m4/m4.links | 0 src/py/src/statement.c | 10 +++++----- test/scr001/chk.code | 7 ++++--- test/scr002/chk.def | 7 +++++++ test/scr003/chk.define | 3 ++- test/scr005/chk.nl | 3 +++ test/scr006/chk.offt | 2 ++ test/scr007/chk.proto | 3 +++ test/scr008/chk.pubdef | 4 ++-- test/scr009/chk.srcfiles | 4 ++++ test/scr010/chk.str | 2 ++ test/scr011/chk.tags | 2 ++ test/scr013/chk.stats | 4 +++- 14 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 dist/pubdef.in create mode 100644 docs_src/m4/m4.links diff --git a/dist/pubdef.in b/dist/pubdef.in new file mode 100644 index 0000000..e69de29 diff --git a/docs_src/m4/m4.links b/docs_src/m4/m4.links new file mode 100644 index 0000000..e69de29 diff --git a/src/py/src/statement.c b/src/py/src/statement.c index a982e52..449b5e3 100644 --- a/src/py/src/statement.c +++ b/src/py/src/statement.c @@ -260,13 +260,13 @@ int pydbsql_statement_recompile(pydbsql_Statement* self, PyObject* params) * version 3.2.2 or later. For older DBSQL releases, that might not * even define DBSQL_VERSION_NUMBER, we do it the manual way. */ - #ifdef DBSQL_VERSION_NUMBER - #if DBSQL_VERSION_NUMBER >= 3002002 +#ifdef DBSQL_VERSION_NUMBER +#if DBSQL_VERSION_NUMBER >= 3002002 (void)dbsql_transfer_bindings(self->st, new_st); - #endif - #else +#endif +#else statement_bind_parameters(self, params); - #endif +#endif (void)dbsql_finalize(self->st); self->st = new_st; diff --git a/test/scr001/chk.code b/test/scr001/chk.code index 9413e89..f1435c3 100644 --- a/test/scr001/chk.code +++ b/test/scr001/chk.code @@ -2,14 +2,15 @@ # # Check to make sure that the code samples in the documents build. -d=../../../db_docs +d=../../docs +b=../../build_unix [ -d $d ] || { echo 'FAIL: cannot find source distribution directory.' exit 1 } -[ -f ../libsqldb.a ] || (cd .. && make libsqldb.a) || { - echo 'FAIL: unable to find or build libsqldb.a' +[ -f $b/libdbsql.a ] || (cd $b && make libdbsql.a) || { + echo 'FAIL: unable to find or build libdbsql.a' exit 1 } diff --git a/test/scr002/chk.def b/test/scr002/chk.def index f09a17e..8a05a17 100644 --- a/test/scr002/chk.def +++ b/test/scr002/chk.def @@ -15,8 +15,15 @@ f=$d/build_win32/libdb.def t1=__1 t2=__2 +trap 'rm -f $t1 $t2' 0 1 2 3 13 15 + exitv=0 +[ -f $f ] || { + echo 'FAIL: unable to find or build' $f + exit 1 +} + sed '/; /d' $f | egrep @ | awk '{print $1}' | diff --git a/test/scr003/chk.define b/test/scr003/chk.define index 8731a6d..48695ae 100644 --- a/test/scr003/chk.define +++ b/test/scr003/chk.define @@ -15,8 +15,9 @@ t1=__1 t2=__2 t3=__3 +trap 'rm -f $t1 $t2 $t3' 0 1 2 3 13 15 + find $d -name '*.c' -o -name '*.cpp' | - sed -e '/queue.h/d' | xargs egrep '^[ ][ ]*#' > $t1 test -s $t1 && { echo "FAIL: found #defines with leading white space:" diff --git a/test/scr005/chk.nl b/test/scr005/chk.nl index f478fd5..17299dd 100644 --- a/test/scr005/chk.nl +++ b/test/scr005/chk.nl @@ -9,11 +9,14 @@ d=../.. exit 1 } +trap 'rm -f t t.c' 0 1 2 3 13 15 + cat << END_OF_CODE > t.c #include #include #include +#include int chk(FILE *, char *); diff --git a/test/scr006/chk.offt b/test/scr006/chk.offt index 8eee7e0..5f22780 100644 --- a/test/scr006/chk.offt +++ b/test/scr006/chk.offt @@ -11,6 +11,8 @@ d=../.. t=__1 +trap 'rm -f $t1' 0 1 2 3 13 15 + egrep -w off_t $d/*/*.[ch] $d/*/*.in | sed -e "/_/d" > $t diff --git a/test/scr007/chk.proto b/test/scr007/chk.proto index 7ed177e..c4efd53 100644 --- a/test/scr007/chk.proto +++ b/test/scr007/chk.proto @@ -13,7 +13,10 @@ t1=__1 t2=__2 t3=__3 +trap 'rm -f $t1 $t2 $t3' 0 1 2 3 13 15 + egrep '__P' $d/src/inc/*.h | + sed -e '/db_int.h/d' | sed -e 's/[ ][ ]*__P.*//' \ -e 's/^.*[ *]//' \ > $t1 diff --git a/test/scr008/chk.pubdef b/test/scr008/chk.pubdef index 0593571..1a883aa 100644 --- a/test/scr008/chk.pubdef +++ b/test/scr008/chk.pubdef @@ -61,7 +61,7 @@ Check that pubdef.in has everything listed in dbsql.in. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= END_OF_TEXT -f=$d/src/db.in +f=$d/src/dbsql.in sed -n \ -e 's/^#define[ ]*\(DBSQL_[A-Z_0-9][A-Z_0-9]*\).*/\1/p' \ -e 's/^[ ]*\(DBSQL_[A-Z_]*\)=[0-9].*/\1/p' \ @@ -77,7 +77,7 @@ done cat < $t1 diff --git a/test/scr010/chk.str b/test/scr010/chk.str index e1cf232..b66a73b 100644 --- a/test/scr010/chk.str +++ b/test/scr010/chk.str @@ -11,6 +11,8 @@ d=../.. t1=__1 +trap 'rm -f $t1' 0 1 2 3 13 15 + sed -e '/^#include/d' \ -e '/"/!d' \ -e 's/^[^"]*//' \ diff --git a/test/scr011/chk.tags b/test/scr011/chk.tags index 97428dc..8d60657 100644 --- a/test/scr011/chk.tags +++ b/test/scr011/chk.tags @@ -13,6 +13,8 @@ d=../.. t1=__1 t2=__2 +trap 'rm -f $t1 $t2' 0 1 2 3 13 15 + (cd $d && ls -F | egrep / | sort | sed -e 's/\///' \ -e '/_\//d' \ diff --git a/test/scr013/chk.stats b/test/scr013/chk.stats index d194750..77bce2b 100644 --- a/test/scr013/chk.stats +++ b/test/scr013/chk.stats @@ -16,11 +16,13 @@ docs=$d/docs_src exitv=0 t=__tmp +trap 'rm -f $t1 IGNORE' 0 1 2 3 13 15 + # Extract the field names for a structure from the dbsql.h file. inc_fields() { sed -e "/struct $1 {/,/^};$/p" \ - -e d < $d/src/inc/dbsql.in | + -e d < $d/src/dbsql.in | sed -e 1d \ -e '$d' \ -e '/;/!d' \