blob: ac7cd85c465fff127f7b5851a89265610fcbc62c [file] [log] [blame]
danielk197765839c62007-08-30 08:08:17 +00001# 2007 Aug 29
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# $Id: mallocD.test,v 1.1 2007/08/30 08:08:17 danielk1977 Exp $
13
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16source $testdir/malloc_common.tcl
17
18sqlite3_simulate_device -char atomic
19
20set PREP {
21 PRAGMA page_size = 1024;
22 CREATE TABLE abc(a, b, c);
23}
24
25do_malloc_test mallocD-1 -sqlprep $PREP -sqlbody {
26 INSERT INTO abc VALUES(1, 2, 3);
27}
28
29do_malloc_test mallocD-2 -sqlprep $PREP -sqlbody {
30 BEGIN;
31 INSERT INTO abc VALUES(1, 2, 3);
32 INSERT INTO abc VALUES(4, 5, 6);
33 ROLLBACK;
34}
35
36do_malloc_test mallocD-3 -sqlprep $PREP -sqlbody {
37 BEGIN;
38 INSERT INTO abc VALUES(1, 2, 3);
39 INSERT INTO abc VALUES(4, 5, randstr(1500,1500));
40 COMMIT;
41}
42
43do_malloc_test mallocD-4 -sqlprep $PREP -sqlbody {
44 ATTACH 'test2.db' AS aux;
45 BEGIN;
46 CREATE TABLE aux.def(d, e, f);
47 INSERT INTO abc VALUES(4, 5, 6);
48 COMMIT;
49}
50
51sqlite3_simulate_device -char {}
52
53finish_test
54