Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/sqlite/src/test/attachmalloc.test

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/attach4.test ('k') | third_party/sqlite/src/test/auth.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2005 September 19 1 # 2005 September 19
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #************************************************************************* 10 #*************************************************************************
11 # This file implements regression tests for SQLite library. The 11 # This file implements regression tests for SQLite library. The
12 # focus of this script is testing the ATTACH statement and 12 # focus of this script is testing the ATTACH statement and
13 # specifically out-of-memory conditions within that command. 13 # specifically out-of-memory conditions within that command.
14 # 14 #
15 # $Id: attachmalloc.test,v 1.10 2008/10/22 10:45:38 danielk1977 Exp $ 15 # $Id: attachmalloc.test,v 1.10 2008/10/22 10:45:38 danielk1977 Exp $
16 # 16 #
17 17
18 set testdir [file dirname $argv0] 18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl 19 source $testdir/tester.tcl
20 20
21 ifcapable !memdebug||!attach { 21 ifcapable !memdebug||!attach {
22 finish_test 22 finish_test
23 return 23 return
24 } 24 }
25 25
26 source $testdir/malloc_common.tcl 26 source $testdir/malloc_common.tcl
27 27
28 do_malloc_test attachmalloc-1 -tclprep { 28 do_malloc_test attachmalloc-1 -tclprep {
29 db close 29 catch { db close }
30 for {set i 2} {$i<=4} {incr i} { 30 for {set i 2} {$i<=4} {incr i} {
31 catch { db$i close }
31 file delete -force test$i.db 32 file delete -force test$i.db
32 file delete -force test$i.db-journal 33 file delete -force test$i.db-journal
33 } 34 }
34 } -tclbody { 35 } -tclbody {
35 if {[catch {sqlite3 db test.db}]} { 36 if {[catch {sqlite3 db test.db}]} {
36 error "out of memory" 37 error "out of memory"
37 } 38 }
38 sqlite3_db_config_lookaside db 0 0 0 39 sqlite3_db_config_lookaside db 0 0 0
39 sqlite3_extended_result_codes db 1 40 sqlite3_extended_result_codes db 1
40 } -sqlbody { 41 } -sqlbody {
(...skipping 12 matching lines...) Expand all
53 db2 eval { 54 db2 eval {
54 CREATE TABLE t1(a, b, c); 55 CREATE TABLE t1(a, b, c);
55 CREATE INDEX i1 ON t1(a, b); 56 CREATE INDEX i1 ON t1(a, b);
56 } 57 }
57 db2 close 58 db2 close
58 } -sqlbody { 59 } -sqlbody {
59 CREATE TABLE t1(d, e, f); 60 CREATE TABLE t1(d, e, f);
60 ATTACH 'test2.db' AS db1; 61 ATTACH 'test2.db' AS db1;
61 } 62 }
62 63
64 set enable_shared_cache [sqlite3_enable_shared_cache 1]
65 sqlite3 dbaux test3.db
66 dbaux eval {SELECT * FROM sqlite_master}
67 do_malloc_test attachmalloc-3 -sqlbody {
68 SELECT * FROM sqlite_master;
69 ATTACH 'test3.db' AS three;
70 } -cleanup {
71 db eval { DETACH three }
72 }
73 dbaux close
74 sqlite3_enable_shared_cache $enable_shared_cache
75
76
63 finish_test 77 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/attach4.test ('k') | third_party/sqlite/src/test/auth.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698