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

Unified Diff: third_party/sqlite/src/test/capi3d.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/capi3c.test ('k') | third_party/sqlite/src/test/capi3e.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/capi3d.test
diff --git a/third_party/sqlite/src/test/capi3d.test b/third_party/sqlite/src/test/capi3d.test
index e346029f92f6b8300aae73680cf593641ec149c2..49e64476ebb5f5698d175185d8f566e331b2bbd5 100644
--- a/third_party/sqlite/src/test/capi3d.test
+++ b/third_party/sqlite/src/test/capi3d.test
@@ -10,7 +10,8 @@
#***********************************************************************
# This file implements regression tests for SQLite library.
#
-# This file is devoted to testing the sqlite3_next_stmt interface.
+# This file is devoted to testing the sqlite3_next_stmt and
+# sqlite3_stmt_readonly interfaces.
#
# $Id: capi3d.test,v 1.2 2008/07/14 15:11:20 drh Exp $
#
@@ -88,6 +89,28 @@ for {set i 1} {$i<=100} {incr i} {
sqlite3_next_stmt db 0
} {}
}
-
+
+# Tests for the is-read-only interface.
+#
+proc test_is_readonly {testname sql truth} {
+ do_test $testname [format {
+ set DB [sqlite3_connection_pointer db]
+ set STMT [sqlite3_prepare $DB {%s} -1 TAIL]
+ set rc [sqlite3_stmt_readonly $STMT]
+ sqlite3_finalize $STMT
+ set rc
+ } $sql] $truth
+}
+
+test_is_readonly capi3d-2.1 {SELECT * FROM sqlite_master} 1
+test_is_readonly capi3d-2.2 {CREATE TABLE t1(x)} 0
+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
+do_test capi3-2.99 {
+ sqlite3_stmt_readonly 0
+} 1
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/capi3c.test ('k') | third_party/sqlite/src/test/capi3e.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698