1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Tests for the new asynchronous IO API. (CVS 6549)

FossilOrigin-Name: 11b2564e7159168cd0815bb9bc93688586fad1e0
This commit is contained in:
danielk1977
2009-04-25 08:39:14 +00:00
parent 4fa326564a
commit 6f050aa2bf
10 changed files with 306 additions and 132 deletions

View File

@@ -6,12 +6,12 @@
#***********************************************************************
# This file runs all tests.
#
# $Id: async.test,v 1.19 2009/04/11 10:25:04 danielk1977 Exp $
# $Id: async.test,v 1.20 2009/04/25 08:39:15 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
if {[catch {sqlite3async_enable}]} {
if {[info commands sqlite3async_initialize] eq ""} {
# The async logic is not built into this system
finish_test
return
@@ -41,15 +41,15 @@ set ASYNC_INCLUDE {
}
# Enable asynchronous IO.
sqlite3async_enable 1
sqlite3async_initialize "" 1
rename do_test async_really_do_test
proc do_test {name args} {
uplevel async_really_do_test async_io-$name $args
sqlite3async_start
sqlite3async_halt idle
sqlite3async_control halt idle
sqlite3async_wait
sqlite3async_halt never
sqlite3async_control halt never
}
foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
@@ -62,20 +62,20 @@ foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
# [file delete]). If the asynchronous backend still has the file
# open, it will become confused.
#
sqlite3async_halt idle
sqlite3async_control halt idle
sqlite3async_start
sqlite3async_wait
sqlite3async_halt never
sqlite3async_control halt never
}
# Flush the write-queue and disable asynchronous IO. This should ensure
# all allocated memory is cleaned up.
set sqlite3async_trace 1
sqlite3async_halt idle
sqlite3async_control halt idle
sqlite3async_start
sqlite3async_wait
sqlite3async_halt never
sqlite3async_enable 0
sqlite3async_control halt never
sqlite3async_shutdown
set sqlite3async_trace 0
rename do_test {}