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