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

Unified Diff: third_party/sqlite/src/test/thread2.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/thread1.test ('k') | third_party/sqlite/src/test/thread_common.tcl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/thread2.test
diff --git a/third_party/sqlite/src/test/thread2.test b/third_party/sqlite/src/test/thread2.test
index 2ec75a24cd19d0fd0a9e3f67641bf3e0174b5713..dad2bf2c5f4b1881af82362c11818b8093e9f762 100644
--- a/third_party/sqlite/src/test/thread2.test
+++ b/third_party/sqlite/src/test/thread2.test
@@ -17,11 +17,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
-ifcapable !mutex {
- finish_test
- return
-}
-
+if {[run_thread_tests]==0} { finish_test ; return }
# Skip this whole file if the thread testing code is not enabled
#
@@ -29,10 +25,6 @@ if {[llength [info command thread_step]]==0 || [sqlite3 -has-codec]} {
finish_test
return
}
-if {![info exists threadsOverrideEachOthersLocks]} {
- finish_test
- return
-}
# Create some data to work with
#
@@ -121,118 +113,6 @@ do_test thread2-2.9 {
thread_halt A
thread_halt B
-# Save the original (correct) value of threadsOverrideEachOthersLocks
-# so that it can be restored. If this value is left set incorrectly, lots
-# of things will go wrong in future tests.
-#
-set orig_threadOverride $threadsOverrideEachOthersLocks
-
-# Pretend we are on a system (like RedHat9) were threads do not
-# override each others locks.
-#
-set threadsOverrideEachOthersLocks 0
-
-# Verify that we can move database connections between threads as
-# long as no locks are held.
-#
-do_test thread2-3.1 {
- thread_create A test.db
- set DB [thread_db_get A]
- thread_halt A
-} {}
-do_test thread2-3.2 {
- set STMT [sqlite3_prepare $DB {SELECT a FROM t1 LIMIT 1} -1 TAIL]
- sqlite3_step $STMT
-} SQLITE_ROW
-do_test thread2-3.3 {
- sqlite3_column_int $STMT 0
-} 1
-do_test thread2-3.4 {
- sqlite3_finalize $STMT
-} SQLITE_OK
-do_test thread2-3.5 {
- set STMT [sqlite3_prepare $DB {SELECT max(a) FROM t1} -1 TAIL]
- sqlite3_step $STMT
-} SQLITE_ROW
-do_test thread2-3.6 {
- sqlite3_column_int $STMT 0
-} 8
-do_test thread2-3.7 {
- sqlite3_finalize $STMT
-} SQLITE_OK
-do_test thread2-3.8 {
- sqlite3_close $DB
-} {SQLITE_OK}
-
-do_test thread2-3.10 {
- thread_create A test.db
- thread_compile A {SELECT a FROM t1 LIMIT 1}
- thread_step A
- thread_finalize A
- set DB [thread_db_get A]
- thread_halt A
-} {}
-do_test thread2-3.11 {
- set STMT [sqlite3_prepare $DB {SELECT a FROM t1 LIMIT 1} -1 TAIL]
- sqlite3_step $STMT
-} SQLITE_ROW
-do_test thread2-3.12 {
- sqlite3_column_int $STMT 0
-} 1
-do_test thread2-3.13 {
- sqlite3_finalize $STMT
-} SQLITE_OK
-do_test thread2-3.14 {
- sqlite3_close $DB
-} SQLITE_OK
-
-do_test thread2-3.20 {
- thread_create A test.db
- thread_compile A {SELECT a FROM t1 LIMIT 3}
- thread_step A
- set STMT [thread_stmt_get A]
- set DB [thread_db_get A]
- sqlite3_step $STMT
-} SQLITE_ROW
-do_test thread2-3.22 {
- sqlite3_column_int $STMT 0
-} 2
-do_test thread2-3.23 {
- # The unlock fails here. But because we never check the return
- # code from sqlite3OsUnlock (because we cannot do anything about it
- # if it fails) we do not realize that an error has occurred.
- breakpoint
- sqlite3_finalize $STMT
-} SQLITE_OK
-do_test thread2-3.25 {
- thread_db_put A $DB
- thread_halt A
-} {}
-
-do_test thread2-3.30 {
- thread_create A test.db
- thread_compile A {BEGIN}
- thread_step A
- thread_finalize A
- thread_compile A {SELECT a FROM t1 LIMIT 1}
- thread_step A
- thread_finalize A
- set DB [thread_db_get A]
- set STMT [sqlite3_prepare $DB {INSERT INTO t1 VALUES(99,'error')} -1 TAIL]
- sqlite3_step $STMT
-} SQLITE_ERROR
-do_test thread2-3.32 {
- sqlite3_finalize $STMT
-} SQLITE_MISUSE
-do_test thread2-3.33 {
- thread_db_put A $DB
- thread_halt A
-} {}
-
-# VERY important to set the override flag back to its true value.
-#
-set threadsOverrideEachOthersLocks $orig_threadOverride
-
# Also important to halt the worker threads, which are using spin
# locks and eating away CPU cycles.
#
« no previous file with comments | « third_party/sqlite/src/test/thread1.test ('k') | third_party/sqlite/src/test/thread_common.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698