# 2010 July 28 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # set testdir [file dirname $argv0] source $testdir/tester.tcl if {$::tcl_platform(platform)!="unix"} { finish_test return } file_control_chunksize_test db main [expr 1024*1024] do_test fallocate-1.1 { execsql { PRAGMA page_size = 1024; PRAGMA auto_vacuum = 1; CREATE TABLE t1(a, b); } file size test.db } [expr 1*1024*1024] do_test fallocate-1.2 { execsql { INSERT INTO t1 VALUES(1, zeroblob(1024*900)) } file size test.db } [expr 1*1024*1024] do_test fallocate-1.3 { execsql { INSERT INTO t1 VALUES(2, zeroblob(1024*900)) } file size test.db } [expr 2*1024*1024] do_test fallocate-1.4 { execsql { DELETE FROM t1 WHERE a = 1 } file size test.db } [expr 1*1024*1024] do_test fallocate-1.5 { execsql { DELETE FROM t1 WHERE a = 2 } file size test.db } [expr 1*1024*1024] do_test fallocate-1.6 { execsql { PRAGMA freelist_count } } {0} finish_test