/ Check-in [d594608f]
Login

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

Overview
Comment:Fix the crash.test script to accomodate recent changes. (CVS 2712)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d594608ff37bbf1d6866adb337aa2fbcd517eada
User & Date: drh 2005-09-17 17:05:19
Context
2005-09-17
17:58
Fix a memory leak that occurs after malloc fails. (CVS 2713) check-in: 85b931bf user: drh tags: trunk
17:05
Fix the crash.test script to accomodate recent changes. (CVS 2712) check-in: d594608f user: drh tags: trunk
16:48
Fix a bug in the lock2 test script introduced by check-in (2709) (CVS 2711) check-in: c3bf1743 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/crash.test.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
42
43
44
45
46
47
48

49
50
51
52
53
54
55
# 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.18 2005/09/08 12:37:29 drh Exp $

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

# set repeats 100
set repeats 10

................................................................................
# error message. This is "child process exited abnormally" if the crash
# occured.
proc crashsql {crashdelay crashfile sql} {
  set cfile [file join [pwd] $crashfile]

  set f [open crash.tcl w]
  puts $f "sqlite3_crashparams $crashdelay $cfile"

  puts $f {sqlite3 db test.db}

  # This block sets the cache size of the main database to 10
  # pages. This is done in case the build is configured to omit
  # "PRAGMA cache_size".
  puts $f {db eval {SELECT * FROM sqlite_master;}}
  puts $f {set bt [btree_from_db db]}







|







 







>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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.19 2005/09/17 17:05:19 drh Exp $

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

# set repeats 100
set repeats 10

................................................................................
# error message. This is "child process exited abnormally" if the crash
# occured.
proc crashsql {crashdelay crashfile sql} {
  set cfile [file join [pwd] $crashfile]

  set f [open crash.tcl w]
  puts $f "sqlite3_crashparams $crashdelay $cfile"
  puts $f "set sqlite_pending_byte $::sqlite_pending_byte"
  puts $f {sqlite3 db test.db}

  # This block sets the cache size of the main database to 10
  # pages. This is done in case the build is configured to omit
  # "PRAGMA cache_size".
  puts $f {db eval {SELECT * FROM sqlite_master;}}
  puts $f {set bt [btree_from_db db]}