danielk1977 | 65839c6 | 2007-08-30 08:08:17 +0000 | [diff] [blame^] | 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.1 2007/08/30 08:08:17 danielk1977 Exp $ |
| 13 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | source $testdir/malloc_common.tcl |
| 17 | |
| 18 | sqlite3_simulate_device -char atomic |
| 19 | |
| 20 | set PREP { |
| 21 | PRAGMA page_size = 1024; |
| 22 | CREATE TABLE abc(a, b, c); |
| 23 | } |
| 24 | |
| 25 | do_malloc_test mallocD-1 -sqlprep $PREP -sqlbody { |
| 26 | INSERT INTO abc VALUES(1, 2, 3); |
| 27 | } |
| 28 | |
| 29 | do_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 | |
| 36 | do_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 | |
| 43 | do_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 | |
| 51 | sqlite3_simulate_device -char {} |
| 52 | |
| 53 | finish_test |
| 54 | |