AryaWu/sqlite
0
1# 2008 Jan 222#3# The author disclaims copyright to this source code. In place of4# 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: filectrl.test,v 1.2 2008/11/21 00:10:35 aswift Exp $13 14set testdir [file dirname $argv0]15source $testdir/tester.tcl16 17 18do_test filectrl-1.1 {19 file_control_test db20} {}21do_test filectrl-1.2 {22 db eval {CREATE TEMP TABLE x(y);}23 file_control_test db24} {}25do_test filectrl-1.3 {26 db close27 sqlite3 db :memory:28 file_control_test db29} {}30do_test filectrl-1.4 {31 sqlite3 db test.db32 file_control_lasterrno_test db33} {}34do_test filectrl-1.5 {35 db close36 sqlite3 db test_control_lockproxy.db37 file_control_lockproxy_test db [get_pwd]38} {}39do_test filectrl-1.6 {40 sqlite3 db test.db41 set fn [file_control_tempfilename db]42 set fn43} {/etilqs_/}44db close45forcedelete .test_control_lockproxy.db-conch test.proxy46forcedelete test.db test2.db47 48if {$tcl_platform(platform) eq "windows"} {49 do_test filectrl-2.1 {50 sqlite3 db test2.db51 set size [file size test2.db]52 set handle [file_control_win32_get_handle db]53 db close54 forcedelete test2.db55 list $size $handle [expr {$handle != 0}]56 } {/^0 \{0 [0-9A-Fa-f]+\} 1$/}57 58 do_test filectrl-2.2 {59 sqlite3 db test2.db60 execsql {61 CREATE TABLE t1(x);62 INSERT INTO t1 (x) VALUES(RANDOMBLOB(1048576));63 }64 set size [file size test2.db]65 set handle [file_control_win32_get_handle db]66 db close67 forcedelete test2.db68 list $size $handle [expr {$handle != 0}]69 } {/^1\d+ \{0 [0-9A-Fa-f]+\} 1$/}70}71 72finish_test73 