1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Fix test instrumentation problems on shared_err.test. (CVS 4728)

FossilOrigin-Name: 5aef5b0dd8e44a56f84fbc6f843016bca5101987
This commit is contained in:
drh
2008-01-18 17:03:32 +00:00
parent 5ba7cac1d8
commit 1527ff4e52
4 changed files with 30 additions and 18 deletions

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.17 2007/09/03 16:12:10 drh Exp $
# $Id: shared_err.test,v 1.18 2008/01/18 17:03:33 drh Exp $
proc skip {args} {}
@ -112,6 +112,7 @@ do_ioerr_test shared_ioerr-2 -tclprep {
incr ::residx
} -cleanup {
catchsql ROLLBACK
do_test shared_ioerr-2.$n.cleanup.1 {
set res [catchsql {
SELECT max(a), min(a), count(*) FROM (SELECT a FROM t1 order by a);
@ -343,7 +344,8 @@ do_malloc_test shared_err-4 -tclprep {
}
do_test shared_malloc-4.$::n.cleanup.3 {
set rc [sqlite3_finalize $::STMT]
expr {$rc=="SQLITE_OK" || $rc=="SQLITE_ABORT" || $rc=="SQLITE_NOMEM"}
expr {$rc=="SQLITE_OK" || $rc=="SQLITE_ABORT" ||
$rc=="SQLITE_NOMEM" || $rc=="SQLITE_IOERR"}
} {1}
# db2 eval {select * from sqlite_master}
db2 close
@ -411,10 +413,14 @@ do_malloc_test shared_err-8 -tclprep {
}
} -cleanup {
do_test shared_malloc-8.$::n.cleanup.1 {
lrange [execsql {
SELECT a FROM t1;
} db2] 0 1
} {0000000000 1111111111}
set res [catchsql {SELECT a FROM t1} db2]
set ans [lindex $res 1]
if {[lindex $res 0]} {
set r [expr {$ans=="disk I/O error"}]
} else {
set r [expr {[lrange $ans 0 1]=="0000000000 1111111111"}]
}
} {1}
do_test shared_malloc-8.$::n.cleanup.2 {
set rc1 [sqlite3_step $::STMT]
set rc2 [sqlite3_finalize $::STMT]
@ -424,7 +430,8 @@ do_malloc_test shared_err-8 -tclprep {
expr {
($rc1=="SQLITE_DONE" && $rc2=="SQLITE_OK") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_ABORT") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_NOMEM")
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_NOMEM") ||
($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_IOERR")
}
} {1}
db2 close