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

Fix the pager2-3.1 test case so that it does not run if a required

dependence (shared-cache) is omitted from the build.  Fix for
[forum:/forumpost/7a028538a7|forum post 7a028538a7].

FossilOrigin-Name: a77c8a780f884d0cb01d20912cf1aeec0bb7f3999d23117fe5bd82bc4405d483
This commit is contained in:
drh
2023-05-05 14:14:10 +00:00
parent cad6aae45e
commit fb18d81038
3 changed files with 28 additions and 27 deletions

View File

@ -147,24 +147,25 @@ do_test pager2-2.2 {
file size test.db
} {3072}
#-------------------------------------------------------------------------
# Test that shared in-memory databases seem to work.
#
db close
do_test pager2-3.1 {
forcedelete test.db
sqlite3_shutdown
sqlite3_config_uri 1
sqlite3 db1 {file:test.db?mode=memory&cache=shared}
sqlite3 db2 {file:test.db?mode=memory&cache=shared}
sqlite3 db3 test.db
db1 eval { CREATE TABLE t1(a, b) }
db2 eval { INSERT INTO t1 VALUES(1, 2) }
list [catch { db3 eval { INSERT INTO t1 VALUES(3, 4) } } msg] $msg
} {1 {no such table: t1}}
db1 close
ifcapable shared_cache {
#-------------------------------------------------------------------------
# Test that shared in-memory databases seem to work.
#
db close
do_test pager2-3.1 {
forcedelete test.db
sqlite3_shutdown
sqlite3_config_uri 1
sqlite3 db1 {file:test.db?mode=memory&cache=shared}
sqlite3 db2 {file:test.db?mode=memory&cache=shared}
sqlite3 db3 test.db
db1 eval { CREATE TABLE t1(a, b) }
db2 eval { INSERT INTO t1 VALUES(1, 2) }
list [catch { db3 eval { INSERT INTO t1 VALUES(3, 4) } } msg] $msg
} {1 {no such table: t1}}
db1 close
}
finish_test