Artifact 62c1646d36bb91c756029da512cd3d8241933b45:

  • File test/fault1.test — part of check-in [cd8da865a4] at 2014-02-18 20:01:27 on branch trunk — Add crash simulation and recovery test infrastructure. And one test case. (user: dan size: 930)

# 2010 June 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.
#
#***********************************************************************
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set ::testprefix fault1

db close

proc open_test_db {} { 
  sqlite4 db test.db
  btenv testenv
  testenv attach db
  trace add command db delete del_testenv
}

proc del_testenv {args} { 
  testenv delete
}

do_faultsim_test 2.0 -prep {
  forcedelete test.db test.db-wal
  open_test_db
} -body {
  execsql {
    CREATE TABLE t1(x,y);
    INSERT INTO t1 VALUES('abc', 'def');
    SELECT * FROM t1;
  }
} -test {
  faultsim_test_result {0 {abc def}}
  db close
}

finish_test