interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / ext / intck / intckfault.test

42 lines · 1088 bytes Raw Blame History
1# 2024 February 24
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11#
12
13source [file join [file dirname [info script]] intck_common.tcl]
14set testprefix intckfault
15return_if_no_intck
16
17do_execsql_test 1.0 {
18 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
19 INSERT INTO t1 VALUES(1, 2, 3);
20 INSERT INTO t1 VALUES(2, 'two', 'three');
21 INSERT INTO t1 VALUES(3, NULL, NULL);
22 CREATE INDEX i1 ON t1(b, c);
23}
24
25do_faultsim_test 1 -faults oom-t* -prep {
26} -body {
27 set ::ic [sqlite3_intck db main]
28 set nStep 0
29 while {"SQLITE_OK"==[$::ic step]} {
30 incr nStep
31 if {$nStep==3} { $::ic unlock }
32 }
33 set res [$::ic error]
34 $::ic close
35 set res
36} -test {
37 catch { $::ic close }
38 faultsim_test_result {0 {SQLITE_OK {}}} {0 {SQLITE_NOMEM {}}} {0 {SQLITE_NOMEM {out of memory}}}
39}
40
41finish_test
42