SQLite

Check-in [9d7cd1f732]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Check in the file autovacuum_crash.test that should be part of the previous check-in. (CVS 2078)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9d7cd1f732ba6f9d69fc30100a4608b74f212b76
User & Date: danielk1977 2004-11-08 09:51:09.000
Context
2004-11-08
12:32
A few more auto-vacuum tests. (CVS 2079) (check-in: 9d4a60bbd6 user: danielk1977 tags: trunk)
09:51
Check in the file autovacuum_crash.test that should be part of the previous check-in. (CVS 2078) (check-in: 9d7cd1f732 user: danielk1977 tags: trunk)
09:26
Test auto-vacuum mode for crash-proofness. Also fix a bug related to the same. (CVS 2077) (check-in: 839ad771a6 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Added test/autovacuum_crash.test.




































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 2001 September 15
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# This file runs the tests in the file crash.test with auto-vacuum enabled
# databases.
#
# $Id: autovacuum_crash.test,v 1.1 2004/11/08 09:51:09 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl
rename finish_test really_finish_test2
proc finish_test {} {}
set ISQUICK 1

rename sqlite3 real_sqlite3
proc sqlite3 {args} {
  set r [eval "real_sqlite3 $args"]
  if { [llength $args] == 2 } {
    [lindex $args 0] eval {pragma auto_vacuum = 1}
  }
  set r
}

rename do_test really_do_test
proc do_test {args} {
  set sc [concat really_do_test "autovacuum-[lindex $args 0]" \
      [lrange $args 1 end]]
  eval $sc
}

source $testdir/crash.test

rename sqlite3 ""
rename real_sqlite3 sqlite3
rename finish_test ""
rename really_finish_test2 finish_test
rename do_test ""
rename really_do_test do_test
finish_test



Changes to test/crash.test.
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# module "crashtest" compiled with the special "os_test.c" backend is used.
# The os_test.c simulates the kind of file corruption that can occur
# when writes are happening at the moment of power loss.
# 
# The special crash-test module with its os_test.c backend only works
# on Unix.
#
# $Id: crash.test,v 1.10 2004/11/08 09:26:10 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# set repeats 100
set repeats 10








|







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# module "crashtest" compiled with the special "os_test.c" backend is used.
# The os_test.c simulates the kind of file corruption that can occur
# when writes are happening at the moment of power loss.
# 
# The special crash-test module with its os_test.c backend only works
# on Unix.
#
# $Id: crash.test,v 1.11 2004/11/08 09:51:09 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# set repeats 100
set repeats 10

384
385
386
387
388
389
390





391



392





  }
} {1 {child process exited abnormally}}
integrity_check crash-5.4
do_test crash-5.5 {
  signature
} $sig























>
>
>
>
>
|
>
>
>
|
>
>
>
>
>
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
  }
} {1 {child process exited abnormally}}
integrity_check crash-5.4
do_test crash-5.5 {
  signature
} $sig

#--------------------------------------------------------------------------
# The following test cases - crash-6.* - test that a DROP TABLE operation
# is correctly rolled back in the event of a crash while the database file
# is being written. This is mainly to test that all pages are written to the
# journal file before truncation in an auto-vacuum database.
#
do_test crash-6.1 {
  crashsql 1 test.db {
    DROP TABLE abc;
  }
} {1 {child process exited abnormally}}
do_test crash-6.2 {
  signature
} $sig