Added SQLITE_OMIT_DEPRECATED compile time option to leave out deprecated functions. Updated test scripts to skip tests of deprecated functions if they are compiled out. (CVS 5808)

FossilOrigin-Name: ba3711acee6f4659bbf133a23d8f9f37e14d0f38
This commit is contained in:
shane
2008-10-12 00:27:53 +00:00
parent 189077f376
commit eec556d3b7
16 changed files with 151 additions and 79 deletions
+30 -28
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the sqlite_transfer_bindings() API.
#
# $Id: bindxfer.test,v 1.5 2008/03/17 16:23:27 drh Exp $
# $Id: bindxfer.test,v 1.6 2008/10/12 00:27:54 shane Exp $
#
set testdir [file dirname $argv0]
@@ -50,33 +50,35 @@ do_test bindxfer-1.3 {
do_test bindxfer-1.4 {
sqlite3_bind_parameter_count $VM2
} 3
do_test bindxfer-1.5 {
sqlite_bind $VM1 1 one normal
set sqlite_static_bind_value two
sqlite_bind $VM1 2 {} static
sqlite_bind $VM1 3 {} null
sqlite3_transfer_bindings $VM1 $VM2
sqlite_step $VM1 VALUES COLNAMES
} SQLITE_ROW
do_test bindxfer-1.6 {
set VALUES
} {{} {} {}}
do_test bindxfer-1.7 {
sqlite_step $VM2 VALUES COLNAMES
} SQLITE_ROW
do_test bindxfer-1.8 {
set VALUES
} {one two {}}
do_test bindxfer-1.9-misuse {
catch {sqlite3_finalize $VM1}
catch {sqlite3_finalize $VM2}
sqlite3_transfer_bindings $VM1 $VM2
} 21 ;# SQLITE_MISUSE
do_test bindxfer-1.10 {
set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL]
set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL]
sqlite3_transfer_bindings $VM1 $VM2
} 1 ;# SQLITE_ERROR
ifcapable deprecated {
do_test bindxfer-1.5 {
sqlite_bind $VM1 1 one normal
set sqlite_static_bind_value two
sqlite_bind $VM1 2 {} static
sqlite_bind $VM1 3 {} null
sqlite3_transfer_bindings $VM1 $VM2
sqlite_step $VM1 VALUES COLNAMES
} SQLITE_ROW
do_test bindxfer-1.6 {
set VALUES
} {{} {} {}}
do_test bindxfer-1.7 {
sqlite_step $VM2 VALUES COLNAMES
} SQLITE_ROW
do_test bindxfer-1.8 {
set VALUES
} {one two {}}
do_test bindxfer-1.9-misuse {
catch {sqlite3_finalize $VM1}
catch {sqlite3_finalize $VM2}
sqlite3_transfer_bindings $VM1 $VM2
} 21 ;# SQLITE_MISUSE
do_test bindxfer-1.10 {
set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL]
set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL]
sqlite3_transfer_bindings $VM1 $VM2
} 1 ;# SQLITE_ERROR
}
catch {sqlite3_finalize $VM1}
catch {sqlite3_finalize $VM2}
+16 -10
View File
@@ -13,7 +13,7 @@
# This is a copy of the capi3.test file that has been adapted to
# test the new sqlite3_prepare_v2 interface.
#
# $Id: capi3c.test,v 1.19 2008/05/05 16:56:35 drh Exp $
# $Id: capi3c.test,v 1.20 2008/10/12 00:27:54 shane Exp $
#
set testdir [file dirname $argv0]
@@ -1168,15 +1168,19 @@ do_test capi3c-19.4 {
do_test capi3c-19.4.1 {
sqlite3_errmsg $DB
} {no such table: t3}
do_test capi3c-19.4.2 {
sqlite3_expired $STMT
} 1
ifcapable deprecated {
do_test capi3c-19.4.2 {
sqlite3_expired $STMT
} 1
}
do_test capi3c-19.4.3 {
sqlite3_errmsg $DB
} {no such table: t3}
do_test capi3c-19.4.4 {
sqlite3_expired 0
} 1
ifcapable deprecated {
do_test capi3c-19.4.4 {
sqlite3_expired 0
} 1
}
do_test capi3c-19.5 {
sqlite3_reset $STMT
db eval {
@@ -1185,9 +1189,11 @@ do_test capi3c-19.5 {
}
sqlite3_step $STMT
} SQLITE_ROW
do_test capi3c-19.5.2 {
sqlite3_expired $STMT
} 0
ifcapable deprecated {
do_test capi3c-19.5.2 {
sqlite3_expired $STMT
} 0
}
do_test capi3c-19.6 {
sqlite3_column_int $STMT 1
} 2
+9 -7
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing built-in functions.
#
# $Id: func.test,v 1.86 2008/08/04 03:51:24 danielk1977 Exp $
# $Id: func.test,v 1.87 2008/10/12 00:27:54 shane Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -918,12 +918,14 @@ do_test func-22.22 {
# This is to test the deprecated sqlite3_aggregate_count() API.
#
do_test func-23.1 {
sqlite3_create_aggregate db
execsql {
SELECT legacy_count() FROM t6;
}
} {3}
ifcapable deprecated {
do_test func-23.1 {
sqlite3_create_aggregate db
execsql {
SELECT legacy_count() FROM t6;
}
} {3}
}
# The group_concat() function.
#
+4 -2
View File
@@ -13,7 +13,7 @@
# cache context. What happens to connection B if one connection A encounters
# an IO-error whilst reading or writing the file-system?
#
# $Id: shared_err.test,v 1.23 2008/09/29 14:12:57 danielk1977 Exp $
# $Id: shared_err.test,v 1.24 2008/10/12 00:27:54 shane Exp $
proc skip {args} {}
@@ -362,7 +362,9 @@ do_malloc_test shared_err-5 -tclbody {
do_malloc_test shared_err-6 -tclbody {
catch {db close}
sqlite3_thread_cleanup
ifcapable deprecated {
sqlite3_thread_cleanup
}
sqlite3_enable_shared_cache 0
} -cleanup {
sqlite3_enable_shared_cache 1