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

Unified Diff: third_party/sqlite/sqlite-src-3170000/test/backup5.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 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
Index: third_party/sqlite/sqlite-src-3170000/test/backup5.test
diff --git a/third_party/sqlite/sqlite-src-3170000/test/backup5.test b/third_party/sqlite/sqlite-src-3170000/test/backup5.test
new file mode 100644
index 0000000000000000000000000000000000000000..c789adfa691678372b2654c2850409967765ed2a
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3170000/test/backup5.test
@@ -0,0 +1,65 @@
+# 2014 November 13
+#
+# 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.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix backup5
+
+forcedelete test2.db
+
+do_execsql_test 1.0 {
+ CREATE TABLE t1(a, b);
+ CREATE TABLE t2(a, b);
+ INSERT INTO t2 VALUES(1, 1);
+ INSERT INTO t2 VALUES(2, 2);
+ INSERT INTO t2 VALUES(3, 3);
+}
+
+do_test 1.1 {
+ forcecopy test.db test.db2
+ db eval {
+ DROP TABLE t2;
+ INSERT INTO t1 VALUES(zeroblob(1000), zeroblob(1000));
+ INSERT INTO t1 VALUES(randomblob(1000), randomblob(1000));
+ }
+} {}
+
+do_test 1.2 {
+ sqlite3 db2 test.db2
+ set stmt [sqlite3_prepare_v2 db2 "SELECT * FROM t2" -1 dummy]
+ sqlite3_step $stmt
+} {SQLITE_ROW}
+
+do_test 1.3 {
+ list [catch { sqlite3_backup B db2 main db main } msg] $msg
+} {1 {sqlite3_backup_init() failed}}
+
+do_test 1.4 {
+ sqlite3_errmsg db2
+} {destination database is in use}
+
+do_test 1.5 {
+ sqlite3_reset $stmt
+ sqlite3_backup B db2 main db main
+ B step 200
+ B finish
+} {SQLITE_OK}
+
+do_test 1.6 {
+ list [sqlite3_step $stmt] [sqlite3_finalize $stmt]
+} {SQLITE_ERROR SQLITE_ERROR}
+
+do_test 1.7 {
+ sqlite3_errmsg db2
+} {no such table: t2}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/test/backup4.test ('k') | third_party/sqlite/sqlite-src-3170000/test/backup_ioerr.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698