From 7bb481fda9ecb134804b49c2ce77ca28f7eea583 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 30 Mar 2012 20:42:12 -0400 Subject: Imported Upstream version 2.0.3 --- test/tkt-94c04eaadb.test | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 test/tkt-94c04eaadb.test (limited to 'test/tkt-94c04eaadb.test') diff --git a/test/tkt-94c04eaadb.test b/test/tkt-94c04eaadb.test new file mode 100644 index 0000000..cce8a98 --- /dev/null +++ b/test/tkt-94c04eaadb.test @@ -0,0 +1,73 @@ +# 2009 October 19 +# +# 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. +# +#*********************************************************************** +# This file implements regression tests for SQLite library. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +if {[info commands sqlite3async_initialize] eq ""} { + # The async logic is not built into this system + finish_test + return +} + +# Create a database. +do_test tkt-94c94-1.1 { + execsql { CREATE TABLE t1(a, b) } +} {} + +# Grow the file to larger than 4096MB (2^32 bytes) +db close +if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} { + puts "**** Unable to create a file larger than 4096 MB. *****" + finish_test + return +} + +# Switch to async mode. +sqlite3async_initialize "" 1 +sqlite3 db test.db +sqlite3 db2 test.db + +# Read from and write to the db just past the 4096MB mark. +# +do_test tkt-94c94-2.1 { + execsql { CREATE TABLE t2(x, y) } db +} {} +do_test tkt-94c94-2.2 { +breakpoint + execsql { INSERT INTO t2 VALUES(1, 2) } db2 +} {} +do_test tkt-94c94-2.3 { + execsql { SELECT * FROM t2 } db +} {1 2} +do_test tkt-94c94-2.4 { + sqlite3async_control halt idle + sqlite3async_start + sqlite3async_wait +} {} +do_test tkt-94c94-2.5 { + execsql { SELECT * FROM t2 } db +} {1 2} +do_test tkt-94c94-2.6 { + sqlite3async_start + sqlite3async_wait +} {} + +db close +db2 close +sqlite3async_start +sqlite3async_wait +sqlite3async_control halt never +sqlite3async_shutdown + +finish_test -- cgit v1.2.3