1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add test cases for sqlite3_db_mutex(). (CVS 5862)

FossilOrigin-Name: f818e8e5cb20c51922d0b5424f17649e0692f273
This commit is contained in:
danielk1977
2008-11-04 14:55:47 +00:00
parent 2838b47234
commit 5f6d0268fb
4 changed files with 88 additions and 11 deletions

View File

@ -9,7 +9,7 @@
#
#***********************************************************************
#
# $Id: mutex1.test,v 1.15 2008/10/07 15:25:49 drh Exp $
# $Id: mutex1.test,v 1.16 2008/11/04 14:55:47 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -150,6 +150,29 @@ ifcapable threadsafe {
} {0}
}
# Test the sqlite3_db_mutex() function.
#
do_test mutex1.4.1 {
catch {db close}
sqlite3 db test.db
enter_db_mutex db
db eval {SELECT 1, 2, 3}
} {1 2 3}
do_test mutex1.4.2 {
leave_db_mutex db
db eval {SELECT 1, 2, 3}
} {1 2 3}
do_test mutex1.4.3 {
catch {db close}
sqlite3 db test.db -nomutex 1
enter_db_mutex db
db eval {SELECT 1, 2, 3}
} {1 2 3}
do_test mutex1.4.4 {
leave_db_mutex db
db eval {SELECT 1, 2, 3}
} {1 2 3}
do_test mutex1-X {
catch {db close}
sqlite3_shutdown