Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Update tests so that they work properly even if the soft-heap-limit is set low. (CVS 4203) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e01eb99edfa3390e97847a210532847c |
User & Date: | drh 2007-08-10 19:46:14.000 |
Context
2007-08-10
| ||
19:46 | Add a test case to reproduce the database corruption problem reported by ticket #2565. (CVS 4204) (check-in: f267ce8094 user: drh tags: trunk) | |
19:46 | Update tests so that they work properly even if the soft-heap-limit is set low. (CVS 4203) (check-in: e01eb99edf user: drh tags: trunk) | |
16:41 | Add the --soft-heap-limit=N option to the test scripts. Set this value to enforce a soft heap limit across all tests. This changes exposes several new bugs. (CVS 4202) (check-in: 8be8459816 user: drh tags: trunk) | |
Changes
Changes to test/attach2.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # # $Id: attach2.test,v 1.36 2007/08/10 19:46:14 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl # Ticket #354 # |
︙ | ︙ | |||
207 208 209 210 211 212 213 214 215 216 217 218 219 220 | catchsql { INSERT INTO t1 VALUES(1, 2) } db2 } {1 {database is locked}} lock_status 4.4.1 db {main shared temp closed file2 unlocked} lock_status 4.4.2 db2 {main unlocked temp closed file2 unlocked} do_test attach2-4.5 { # Handle 'db2' reserves file2. execsql {BEGIN} db2 execsql {INSERT INTO file2.t1 VALUES(1, 2)} db2 # Lock status: # db - shared(main) | > > > > > > > > > | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | catchsql { INSERT INTO t1 VALUES(1, 2) } db2 } {1 {database is locked}} lock_status 4.4.1 db {main shared temp closed file2 unlocked} lock_status 4.4.2 db2 {main unlocked temp closed file2 unlocked} # We have to make sure that the cache_size and the soft_heap_limit # are large enough to hold the entire change in memory. If either # is set too small, then changes will spill to the database, forcing # a reserved lock to promote to exclusive. That will mess up our # test results. set soft_limit [sqlite3_soft_heap_limit 0] do_test attach2-4.5 { # Handle 'db2' reserves file2. execsql {BEGIN} db2 execsql {INSERT INTO file2.t1 VALUES(1, 2)} db2 # Lock status: # db - shared(main) |
︙ | ︙ | |||
310 311 312 313 314 315 316 317 318 319 320 321 322 323 | do_test attach2-4.15 { execsql {SELECT * FROM t1} db2 } {1 2 1 2} db close db2 close file delete -force test2.db # These tests - attach2-5.* - check that the master journal file is deleted # correctly when a multi-file transaction is committed or rolled back. # # Update: It's not actually created if a rollback occurs, so that test # doesn't really prove too much. foreach f [glob test.db*] {file delete -force $f} | > | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | do_test attach2-4.15 { execsql {SELECT * FROM t1} db2 } {1 2 1 2} db close db2 close file delete -force test2.db sqlite3_soft_heap_limit $soft_limit # These tests - attach2-5.* - check that the master journal file is deleted # correctly when a multi-file transaction is committed or rolled back. # # Update: It's not actually created if a rollback occurs, so that test # doesn't really prove too much. foreach f [glob test.db*] {file delete -force $f} |
︙ | ︙ |
Changes to test/capi3b.test.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the callback-free C/C++ API and in # particular the behavior of sqlite3_step() when trying to commit # with lock contention. # | | > > > > > > > > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the callback-free C/C++ API and in # particular the behavior of sqlite3_step() when trying to commit # with lock contention. # # $Id: capi3b.test,v 1.4 2007/08/10 19:46:14 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl # These tests depend on the pager holding changes in cache # until it is time to commit. But that won't happen if the # soft-heap-limit is set too low. So disable the soft heap limit # for the duration of this test. # sqlite3_soft_heap_limit 0 set DB [sqlite3_connection_pointer db] sqlite3 db2 test.db set DB2 [sqlite3_connection_pointer db2] # Create some data in the database # |
︙ | ︙ | |||
128 129 130 131 132 133 134 135 | do_test capi3b-2.12 { sqlite3_finalize $VM1 sqlite3_finalize $VM2 execsql {SELECT * FROM t1} } {1 2 3 4} catch {db2 close} finish_test | > > | 136 137 138 139 140 141 142 143 144 145 | do_test capi3b-2.12 { sqlite3_finalize $VM1 sqlite3_finalize $VM2 execsql {SELECT * FROM t1} } {1 2 3 4} catch {db2 close} sqlite3_soft_heap_limit $soft_limit finish_test |