xref: /sqlite-3.40.0/test/ioerr3.test (revision de4fcfdd)
1fc02882bSdanielk1977# 2007 December 19
2fc02882bSdanielk1977#
3fc02882bSdanielk1977# The author disclaims copyright to this source code.  In place of
4fc02882bSdanielk1977# a legal notice, here is a blessing:
5fc02882bSdanielk1977#
6fc02882bSdanielk1977#    May you do good and not evil.
7fc02882bSdanielk1977#    May you find forgiveness for yourself and forgive others.
8fc02882bSdanielk1977#    May you share freely, never taking more than you give.
9fc02882bSdanielk1977#
10fc02882bSdanielk1977#***********************************************************************
11fc02882bSdanielk1977# This file implements regression tests for SQLite library.  The
12fc02882bSdanielk1977# focus of this file is testing for correct handling of I/O errors
13fc02882bSdanielk1977# in conjunction with very small soft-heap-limit values.
14fc02882bSdanielk1977#
15*de4fcfddSdrh# $Id: ioerr3.test,v 1.2 2008/01/19 23:50:26 drh Exp $
16fc02882bSdanielk1977
17fc02882bSdanielk1977set testdir [file dirname $argv0]
18fc02882bSdanielk1977source $testdir/tester.tcl
19fc02882bSdanielk1977
20fc02882bSdanielk1977do_ioerr_test ioerr3-1 -sqlprep {
21fc02882bSdanielk1977  CREATE TABLE t1(id INTEGER, name TEXT);
22fc02882bSdanielk1977} -tclbody {
23fc02882bSdanielk1977  sqlite3_soft_heap_limit 8192
24fc02882bSdanielk1977  db cache size 0
25fc02882bSdanielk1977  execsql BEGIN
26fc02882bSdanielk1977  for {set ii 0} {$ii < 100} {incr ii} {
27fc02882bSdanielk1977    execsql {
28fc02882bSdanielk1977      INSERT INTO t1(id, name) VALUES (1,
29fc02882bSdanielk1977'A1234567890B1234567890C1234567890D1234567890E1234567890F1234567890G1234567890H1234567890I1234567890J1234567890K1234567890L1234567890M1234567890N1234567890O1234567890P1234567890Q1234567890R1234567890'
30fc02882bSdanielk1977      );
31fc02882bSdanielk1977    }
32fc02882bSdanielk1977  }
33fc02882bSdanielk1977  execsql COMMIT
34fc02882bSdanielk1977}
35fc02882bSdanielk1977
36*de4fcfddSdrhdo_ioerr_test ioerr3-2 -sqlbody {
37*de4fcfddSdrh  CREATE TEMP TABLE t1(x,y);
38*de4fcfddSdrh}
39*de4fcfddSdrh
40fc02882bSdanielk1977sqlite3_soft_heap_limit 0
41fc02882bSdanielk1977
42fc02882bSdanielk1977finish_test
43