Update the rest of the malloc failure test scripts to use the new interface. (CVS 4296)

FossilOrigin-Name: b076e1655d6bae5ae10e6ceee646f502435da66a
This commit is contained in:
danielk1977
2007-08-25 13:37:48 +00:00
parent cdc3a6bcbc
commit 222a757dba
9 changed files with 88 additions and 375 deletions
+19 -20
View File
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi3.test,v 1.52 2007/08/22 02:56:44 drh Exp $
# $Id: capi3.test,v 1.53 2007/08/25 13:37:49 danielk1977 Exp $
#
set testdir [file dirname $argv0]
@@ -750,26 +750,25 @@ foreach {code english} $code2english {
}
# Test the error message when a "real" out of memory occurs.
if {[info command sqlite_malloc_stat]!=""} {
set sqlite_malloc_fail 1
do_test capi3-10-1 {
sqlite3 db test.db
set DB [sqlite3_connection_pointer db]
sqlite_malloc_fail 1
catchsql {
select * from sqlite_master;
}
} {1 {out of memory}}
do_test capi3-10-2 {
sqlite3_errmsg $::DB
} {out of memory}
ifcapable {utf16} {
do_test capi3-10-3 {
utf8 [sqlite3_errmsg16 $::DB]
if {[info command sqlite3_memdebug_fail]!=""} {
do_test capi3-10-1 {
sqlite3 db test.db
set DB [sqlite3_connection_pointer db]
sqlite3_memdebug_fail 0 0
catchsql {
select * from sqlite_master;
}
} {1 {out of memory}}
do_test capi3-10-2 {
sqlite3_errmsg $::DB
} {out of memory}
}
db close
sqlite_malloc_fail 0
ifcapable {utf16} {
do_test capi3-10-3 {
utf8 [sqlite3_errmsg16 $::DB]
} {out of memory}
}
db close
sqlite3_memdebug_fail -1 0
}
# The following tests - capi3-11.* - test that a COMMIT or ROLLBACK