summaryrefslogtreecommitdiff
path: root/test/capi3d.test
diff options
context:
space:
mode:
authorHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
committerHans-Christoph Steiner <hans@eds.org>2014-10-16 22:51:43 -0400
commit9f67c0520ea0d5f11a190197cdf746c512db4ce4 (patch)
treec88a33f01f20a3d13a09594f114fffacebd0d1a4 /test/capi3d.test
parentee20336e9c78d2e3782c8d096b9ab4f6ca8ce95f (diff)
parent569c6676a6ddb0ff73821d7693b5e18ddef809b9 (diff)
Merge tag 'upstream/3.2.0'
Upstream version 3.2.0 # gpg: Signature made Thu 16 Oct 2014 10:51:39 PM EDT using RSA key ID 374BBE81 # gpg: Good signature from "Hans-Christoph Steiner <hans@guardianproject.info>" # gpg: aka "Hans-Christoph Steiner <hans@eds.org>" # gpg: aka "Hans-Christoph Steiner <hans@at.or.at>" # gpg: aka "[jpeg image of size 5408]"
Diffstat (limited to 'test/capi3d.test')
-rw-r--r--test/capi3d.test44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/capi3d.test b/test/capi3d.test
index 746ec20..fb8abe8 100644
--- a/test/capi3d.test
+++ b/test/capi3d.test
@@ -108,6 +108,13 @@ db eval {CREATE TABLE t1(x)}
test_is_readonly capi3d-2.3 {INSERT INTO t1 VALUES(5)} 0
test_is_readonly capi3d-2.4 {UPDATE t1 SET x=x+1 WHERE x<0} 0
test_is_readonly capi3d-2.5 {SELECT * FROM t1} 1
+ifcapable wal {
+ test_is_readonly capi3d-2.6 {PRAGMA journal_mode=WAL} 0
+ test_is_readonly capi3d-2.7 {PRAGMA wal_checkpoint} 0
+}
+test_is_readonly capi3d-2.8 {PRAGMA application_id=1234} 0
+test_is_readonly capi3d-2.9 {VACUUM} 0
+test_is_readonly capi3d-2.10 {PRAGMA integrity_check} 1
do_test capi3-2.99 {
sqlite3_stmt_readonly 0
} 1
@@ -137,4 +144,41 @@ do_test capi3d-3.99 {
sqlite3_stmt_busy 0
} {0}
+#--------------------------------------------------------------------------
+# Test the sqlite3_stmt_busy() function with ROLLBACK statements.
+#
+reset_db
+
+do_execsql_test capi3d-4.1 {
+ CREATE TABLE t4(x,y);
+ BEGIN;
+}
+
+do_test capi3d-4.2.1 {
+ breakpoint
+ set ::s1 [sqlite3_prepare_v2 db "ROLLBACK" -1 notused]
+ sqlite3_step $::s1
+} {SQLITE_DONE}
+
+do_test capi3d-4.2.2 {
+ sqlite3_stmt_busy $::s1
+} {1}
+
+do_catchsql_test capi3d-4.2.3 {
+ VACUUM
+} {1 {cannot VACUUM - SQL statements in progress}}
+
+do_test capi3d-4.2.4 {
+ sqlite3_reset $::s1
+} {SQLITE_OK}
+
+do_catchsql_test capi3d-4.2.5 {
+ VACUUM
+} {0 {}}
+
+do_test capi3d-4.2.6 {
+ sqlite3_finalize $::s1
+} {SQLITE_OK}
+
+
finish_test