| OLD | NEW |
| 1 # 2008 June 18 | 1 # 2008 June 18 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| 11 # | 11 # |
| 12 # This file contains tests of the memory allocation subsystem. | 12 # This file contains tests of the memory allocation subsystem. |
| 13 # | 13 # |
| 14 # $Id: memsubsys2.test,v 1.2 2008/08/12 15:21:12 drh Exp $ | 14 # $Id: memsubsys2.test,v 1.2 2008/08/12 15:21:12 drh Exp $ |
| 15 | 15 |
| 16 set testdir [file dirname $argv0] | 16 set testdir [file dirname $argv0] |
| 17 source $testdir/tester.tcl | 17 source $testdir/tester.tcl |
| 18 sqlite3_reset_auto_extension | 18 sqlite3_reset_auto_extension |
| 19 | 19 |
| 20 # This procedure constructs a new database in test.db. It fills | 20 # This procedure constructs a new database in test.db. It fills |
| 21 # this database with many small records (enough to force multiple | 21 # this database with many small records (enough to force multiple |
| 22 # rebalance operations in the btree-layer and to require a large | 22 # rebalance operations in the btree-layer and to require a large |
| 23 # page cache), verifies correct results, then returns. | 23 # page cache), verifies correct results, then returns. |
| 24 # | 24 # |
| 25 proc build_test_db {testname pragmas} { | 25 proc build_test_db {testname pragmas} { |
| 26 catch {db close} | 26 catch {db close} |
| 27 file delete -force test.db test.db-journal | 27 forcedelete test.db test.db-journal |
| 28 sqlite3 db test.db | 28 sqlite3 db test.db |
| 29 db eval $pragmas | 29 db eval $pragmas |
| 30 db eval { | 30 db eval { |
| 31 CREATE TABLE t1(x, y); | 31 CREATE TABLE t1(x, y); |
| 32 CREATE TABLE t2(a, b); | 32 CREATE TABLE t2(a, b); |
| 33 CREATE INDEX i1 ON t1(x,y); | 33 CREATE INDEX i1 ON t1(x,y); |
| 34 INSERT INTO t1 VALUES(1, 100); | 34 INSERT INTO t1 VALUES(1, 100); |
| 35 INSERT INTO t1 VALUES(2, 200); | 35 INSERT INTO t1 VALUES(2, 200); |
| 36 } | 36 } |
| 37 for {set i 2} {$i<5000} {incr i $i} { | 37 for {set i 2} {$i<5000} {incr i $i} { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } {1} | 164 } {1} |
| 165 do_test memsubsys2-4.11 { | 165 do_test memsubsys2-4.11 { |
| 166 sqlite3_memory_used | 166 sqlite3_memory_used |
| 167 } {0} | 167 } {0} |
| 168 | 168 |
| 169 | 169 |
| 170 | 170 |
| 171 | 171 |
| 172 autoinstall_test_functions | 172 autoinstall_test_functions |
| 173 finish_test | 173 finish_test |
| OLD | NEW |