diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/async.test | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2 opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz |
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/async.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/async.test | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/async.test b/libraries/sqlite/unix/sqlite-3.5.1/test/async.test new file mode 100644 index 0000000..268a7ca --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/async.test | |||
@@ -0,0 +1,78 @@ | |||
1 | # | ||
2 | # May you do good and not evil. | ||
3 | # May you find forgiveness for yourself and forgive others. | ||
4 | # May you share freely, never taking more than you give. | ||
5 | # | ||
6 | #*********************************************************************** | ||
7 | # This file runs all tests. | ||
8 | # | ||
9 | # $Id: async.test,v 1.12 2007/09/14 16:20:01 danielk1977 Exp $ | ||
10 | |||
11 | |||
12 | if {[catch {sqlite3async_enable}]} { | ||
13 | # The async logic is not built into this system | ||
14 | return | ||
15 | } | ||
16 | |||
17 | set testdir [file dirname $argv0] | ||
18 | source $testdir/tester.tcl | ||
19 | rename finish_test really_finish_test | ||
20 | proc finish_test {} { | ||
21 | catch {db close} | ||
22 | catch {db2 close} | ||
23 | catch {db3 close} | ||
24 | } | ||
25 | set ISQUICK 1 | ||
26 | |||
27 | set INCLUDE { | ||
28 | insert.test | ||
29 | insert2.test | ||
30 | insert3.test | ||
31 | lock.test | ||
32 | lock2.test | ||
33 | lock3.test | ||
34 | select1.test | ||
35 | select2.test | ||
36 | select3.test | ||
37 | select4.test | ||
38 | trans.test | ||
39 | } | ||
40 | |||
41 | # Enable asynchronous IO. | ||
42 | sqlite3async_enable 1 | ||
43 | |||
44 | rename do_test really_do_test | ||
45 | proc do_test {name args} { | ||
46 | uplevel really_do_test async_io-$name $args | ||
47 | sqlite3async_start | ||
48 | sqlite3async_halt idle | ||
49 | sqlite3async_wait | ||
50 | } | ||
51 | |||
52 | foreach testfile [lsort -dictionary [glob $testdir/*.test]] { | ||
53 | set tail [file tail $testfile] | ||
54 | if {[lsearch -exact $INCLUDE $tail]<0} continue | ||
55 | source $testfile | ||
56 | |||
57 | # Make sure everything is flushed through. This is because [source]ing | ||
58 | # the next test file will delete the database file on disk (using | ||
59 | # [file delete]). If the asynchronous backend still has the file | ||
60 | # open, it will become confused. | ||
61 | # | ||
62 | sqlite3async_halt idle | ||
63 | sqlite3async_start | ||
64 | sqlite3async_wait | ||
65 | } | ||
66 | |||
67 | # Flush the write-queue and disable asynchronous IO. This should ensure | ||
68 | # all allocated memory is cleaned up. | ||
69 | set sqlite3async_trace 1 | ||
70 | sqlite3async_halt idle | ||
71 | sqlite3async_start | ||
72 | sqlite3async_wait | ||
73 | sqlite3async_enable 0 | ||
74 | set sqlite3async_trace 0 | ||
75 | |||
76 | really_finish_test | ||
77 | rename really_do_test do_test | ||
78 | rename really_finish_test finish_test | ||