sl@0: # 2007 September 5 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # The focus of this file is testing the code in test_async.c. sl@0: # Specifically, it tests that the xFullPathname() method of sl@0: # of the asynchronous vfs works correctly. sl@0: # sl@0: # $Id: async3.test,v 1.3 2007/11/05 17:01:08 danielk1977 Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: if { [info commands sqlite3async_enable]=="" } { sl@0: # The async logic is not built into this system sl@0: puts "Skipping async3 tests: not compiled with required features" sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: db close sl@0: sqlite3async_enable 1 sl@0: sqlite3async_start sl@0: sl@0: set paths { sl@0: chocolate/banana/vanilla/file.db sl@0: chocolate//banana/vanilla/file.db sl@0: chocolate/./banana//vanilla/file.db sl@0: chocolate/banana/./vanilla/file.db sl@0: chocolate/banana/../banana/vanilla/file.db sl@0: chocolate/banana/./vanilla/extra_bit/../file.db sl@0: } sl@0: sl@0: do_test async3-1.0 { sl@0: file mkdir [file join chocolate banana vanilla] sl@0: file delete -force chocolate/banana/vanilla/file.db sl@0: file delete -force chocolate/banana/vanilla/file.db-journal sl@0: } {} sl@0: sl@0: do_test async3-1.1 { sl@0: sqlite3 db chocolate/banana/vanilla/file.db sl@0: execsql { sl@0: CREATE TABLE abc(a, b, c); sl@0: BEGIN; sl@0: INSERT INTO abc VALUES(1, 2, 3); sl@0: } sl@0: } {} sl@0: sl@0: set N 2 sl@0: foreach p $paths { sl@0: sqlite3 db2 $p sl@0: do_test async3-1.$N.1 { sl@0: execsql {SELECT * FROM abc} db2 sl@0: } {} sl@0: do_test async3-1.$N.2 { sl@0: catchsql {INSERT INTO abc VALUES(4, 5, 6)} db2 sl@0: } {1 {database is locked}} sl@0: db2 close sl@0: incr N sl@0: } sl@0: sl@0: db close sl@0: sqlite3async_halt idle sl@0: sqlite3async_wait sl@0: sqlite3async_halt never sl@0: sqlite3async_enable 0 sl@0: finish_test