xref: /sqlite-3.40.0/test/diskfull.test (revision 4dcbdbff)
1# 2001 October 12
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# This file implements regression tests for SQLite library.  The
12# focus of this file is testing for correct handling of disk full
13# errors.
14#
15# $Id: diskfull.test,v 1.1 2004/10/01 14:38:03 drh Exp $
16
17set testdir [file dirname $argv0]
18source $testdir/tester.tcl
19
20do_test diskfull-1.1 {
21  execsql {
22    CREATE TABLE t1(x);
23    INSERT INTO t1 VALUES(randstr(1000,1000));
24    INSERT INTO t1 SELECT * FROM t1;
25  }
26} {}
27do_test diskfull-1.2 {
28  set sqlite_diskfull_pending 1
29  catchsql {
30    INSERT INTO t1 SELECT * FROM t1;
31  }
32} {1 {database is full}}
33do_test diskfull-1.3 {
34  set sqlite_diskfull_pending 1
35  catchsql {
36    DELETE FROM t1;
37  }
38} {1 {database is full}}
39
40finish_test
41