aboutsummaryrefslogtreecommitdiff
path: root/test/shared_err.test
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-01-18 17:03:32 +0000
committerdrh <drh@noemail.net>2008-01-18 17:03:32 +0000
commit1527ff4e528aa9e22eda6a5e644497cdf3256fc9 (patch)
tree19a2d05c8933dbaffe40620cdb9dd43ce6008668 /test/shared_err.test
parent5ba7cac1d81b61eff6851fad96060d286ce4b766 (diff)
downloadsqlite-1527ff4e528aa9e22eda6a5e644497cdf3256fc9.tar.gz
sqlite-1527ff4e528aa9e22eda6a5e644497cdf3256fc9.zip
Fix test instrumentation problems on shared_err.test. (CVS 4728)
FossilOrigin-Name: 5aef5b0dd8e44a56f84fbc6f843016bca5101987
Diffstat (limited to 'test/shared_err.test')
-rw-r--r--test/shared_err.test21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/shared_err.test b/test/shared_err.test
index 7c1794aab..4c6214a38 100644
--- a/test/shared_err.test
+++ b/test/shared_err.test
@@ -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