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/mallocA.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/mallocA.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/mallocA.test | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/mallocA.test b/libraries/sqlite/unix/sqlite-3.5.1/test/mallocA.test new file mode 100644 index 0000000..8c7705f --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/mallocA.test | |||
@@ -0,0 +1,69 @@ | |||
1 | # 2007 April 30 | ||
2 | # | ||
3 | # The author disclaims copyright to this source code. In place of | ||
4 | # 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 | # This file contains additional out-of-memory checks (see malloc.tcl). | ||
12 | # | ||
13 | # $Id: mallocA.test,v 1.6 2007/09/12 17:01:45 danielk1977 Exp $ | ||
14 | |||
15 | set testdir [file dirname $argv0] | ||
16 | source $testdir/tester.tcl | ||
17 | |||
18 | # Only run these tests if memory debugging is turned on. | ||
19 | # | ||
20 | ifcapable !memdebug { | ||
21 | puts "Skipping mallocA tests: not compiled with -DSQLITE_MEMDEBUG..." | ||
22 | finish_test | ||
23 | return | ||
24 | } | ||
25 | |||
26 | source $testdir/malloc_common.tcl | ||
27 | |||
28 | # Construct a test database | ||
29 | # | ||
30 | file delete -force test.db.bu | ||
31 | db eval { | ||
32 | CREATE TABLE t1(a COLLATE NOCASE,b,c); | ||
33 | INSERT INTO t1 VALUES(1,2,3); | ||
34 | INSERT INTO t1 VALUES(1,2,4); | ||
35 | INSERT INTO t1 VALUES(2,3,4); | ||
36 | CREATE INDEX t1i1 ON t1(a); | ||
37 | CREATE INDEX t1i2 ON t1(b,c); | ||
38 | CREATE TABLE t2(x,y,z); | ||
39 | } | ||
40 | db close | ||
41 | file copy test.db test.db.bu | ||
42 | |||
43 | |||
44 | do_malloc_test mallocA-1 -testdb test.db.bu -sqlbody { | ||
45 | ANALYZE | ||
46 | } | ||
47 | ifcapable reindex { | ||
48 | do_malloc_test mallocA-2 -testdb test.db.bu -sqlbody { | ||
49 | REINDEX; | ||
50 | } | ||
51 | do_malloc_test mallocA-3 -testdb test.db.bu -sqlbody { | ||
52 | REINDEX t1; | ||
53 | } | ||
54 | do_malloc_test mallocA-4 -testdb test.db.bu -sqlbody { | ||
55 | REINDEX main.t1; | ||
56 | } | ||
57 | do_malloc_test mallocA-5 -testdb test.db.bu -sqlbody { | ||
58 | REINDEX nocase; | ||
59 | } | ||
60 | } | ||
61 | |||
62 | # Ensure that no file descriptors were leaked. | ||
63 | do_test malloc-99.X { | ||
64 | catch {db close} | ||
65 | set sqlite_open_file_count | ||
66 | } {0} | ||
67 | |||
68 | file delete -force test.db.bu | ||
69 | finish_test | ||