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/journal1.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/journal1.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/journal1.test | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/journal1.test b/libraries/sqlite/unix/sqlite-3.5.1/test/journal1.test new file mode 100644 index 0000000..a1b17b4 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/journal1.test | |||
@@ -0,0 +1,67 @@ | |||
1 | # 2005 March 15 | ||
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 implements regression tests for SQLite library. | ||
12 | # | ||
13 | # This file implements tests to make sure that leftover journals from | ||
14 | # prior databases do not try to rollback into new databases. | ||
15 | # | ||
16 | # $Id: journal1.test,v 1.2 2005/03/20 22:54:56 drh Exp $ | ||
17 | |||
18 | |||
19 | set testdir [file dirname $argv0] | ||
20 | source $testdir/tester.tcl | ||
21 | |||
22 | # These tests will not work on windows because windows uses | ||
23 | # manditory file locking which breaks the file copy command. | ||
24 | # | ||
25 | if {$tcl_platform(platform)=="windows"} { | ||
26 | finish_test | ||
27 | return | ||
28 | } | ||
29 | |||
30 | # Create a smaple database | ||
31 | # | ||
32 | do_test journal1-1.1 { | ||
33 | execsql { | ||
34 | CREATE TABLE t1(a,b); | ||
35 | INSERT INTO t1 VALUES(1,randstr(10,400)); | ||
36 | INSERT INTO t1 VALUES(2,randstr(10,400)); | ||
37 | INSERT INTO t1 SELECT a+2, a||b FROM t1; | ||
38 | INSERT INTO t1 SELECT a+4, a||b FROM t1; | ||
39 | SELECT count(*) FROM t1; | ||
40 | } | ||
41 | } 8 | ||
42 | |||
43 | # Make changes to the database and save the journal file. | ||
44 | # Then delete the database. Replace the the journal file | ||
45 | # and try to create a new database with the same name. The | ||
46 | # old journal should not attempt to rollback into the new | ||
47 | # database. | ||
48 | # | ||
49 | do_test journal1-1.2 { | ||
50 | execsql { | ||
51 | BEGIN; | ||
52 | DELETE FROM t1; | ||
53 | } | ||
54 | file copy -force test.db-journal test.db-journal-bu | ||
55 | execsql { | ||
56 | ROLLBACK; | ||
57 | } | ||
58 | db close | ||
59 | file delete test.db | ||
60 | file copy test.db-journal-bu test.db-journal | ||
61 | sqlite3 db test.db | ||
62 | catchsql { | ||
63 | SELECT * FROM sqlite_master | ||
64 | } | ||
65 | } {0 {}} | ||
66 | |||
67 | finish_test | ||