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

Unified Diff: third_party/sqlite/src/test/close.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/check.test ('k') | third_party/sqlite/src/test/closure01.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/close.test
diff --git a/third_party/sqlite/src/test/close.test b/third_party/sqlite/src/test/close.test
new file mode 100644
index 0000000000000000000000000000000000000000..d5d6391ae5e58be31e669f29d753cc1d970004e5
--- /dev/null
+++ b/third_party/sqlite/src/test/close.test
@@ -0,0 +1,78 @@
+# 2013 May 14
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Test some specific circumstances to do with shared cache mode.
+#
+
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set ::testprefix close
+
+do_execsql_test 1.0 {
+ CREATE TABLE t1(x);
+ INSERT INTO t1 VALUES('one');
+ INSERT INTO t1 VALUES('two');
+ INSERT INTO t1 VALUES('three');
+}
+db close
+
+do_test 1.1 {
+ set DB [sqlite3_open test.db]
+ sqlite3_close_v2 $DB
+} {SQLITE_OK}
+
+do_test 1.2.1 {
+ set DB [sqlite3_open test.db]
+ set STMT [sqlite3_prepare $DB "SELECT * FROM t1" -1 dummy]
+ sqlite3_close_v2 $DB
+} {SQLITE_OK}
+do_test 1.2.2 {
+ sqlite3_finalize $STMT
+} {SQLITE_OK}
+
+do_test 1.3.1 {
+ set DB [sqlite3_open test.db]
+ set STMT [sqlite3_prepare $DB "SELECT * FROM t1" -1 dummy]
+ sqlite3_step $STMT
+ sqlite3_close_v2 $DB
+} {SQLITE_OK}
+
+do_test 1.3.2 {
+ sqlite3_column_text $STMT 0
+} {one}
+
+do_test 1.3.3 {
+ sqlite3_finalize $STMT
+} {SQLITE_OK}
+
+do_test 1.4.1 {
+ set DB [sqlite3_open test.db]
+ set STMT [sqlite3_prepare $DB "SELECT * FROM t1" -1 dummy]
+ sqlite3_step $STMT
+ sqlite3_close_v2 $DB
+} {SQLITE_OK}
+
+do_test 1.4.2 {
+ list [sqlite3_step $STMT] [sqlite3_column_text $STMT 0]
+} {SQLITE_ROW two}
+
+do_test 1.4.3 {
+ list [catch {
+ sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 dummy
+ } msg] $msg
+} {1 {(21) library routine called out of sequence}}
+
+do_test 1.4.4 {
+ sqlite3_finalize $STMT
+} {SQLITE_OK}
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/check.test ('k') | third_party/sqlite/src/test/closure01.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698