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

Unified Diff: third_party/sqlite/src/test/incrblobfault.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/incrblob3.test ('k') | third_party/sqlite/src/test/incrvacuum.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/incrblobfault.test
diff --git a/third_party/sqlite/src/test/incrblobfault.test b/third_party/sqlite/src/test/incrblobfault.test
new file mode 100644
index 0000000000000000000000000000000000000000..d125471c4bbc0ea013b5ec66d3b398183eb8b3d5
--- /dev/null
+++ b/third_party/sqlite/src/test/incrblobfault.test
@@ -0,0 +1,70 @@
+# 2010 October 26
+#
+# 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 incrblobfault
+
+do_execsql_test 1.0 {
+ CREATE TABLE blob(x INTEGER PRIMARY KEY, v BLOB);
+ INSERT INTO blob VALUES(1, 'hello world');
+ INSERT INTO blob VALUES(2, 'world hello');
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+ INSERT INTO blob SELECT NULL, v FROM blob;
+}
+
+do_faultsim_test 1 -prep {
+ sqlite3 db test.db
+ set ::blob [db incrblob blob v 1]
+} -body {
+ if {[catch {sqlite3_blob_reopen $::blob 1000}]} {
+ error [sqlite3_errmsg db]
+ }
+} -test {
+ faultsim_test_result {0 {}}
+ close $::blob
+}
+
+do_faultsim_test 2 -prep {
+ sqlite3 db test.db
+ set ::blob [db incrblob blob v 1]
+} -body {
+ if {[catch {sqlite3_blob_reopen $::blob -1}]} {
+ error [sqlite3_errmsg db]
+ }
+} -test {
+ faultsim_test_result {1 {no such rowid: -1}}
+ close $::blob
+}
+
+do_faultsim_test 3 -prep {
+ sqlite3 db test.db
+} -body {
+ set ::blob [db incrblob blob v 1]
+ gets $::blob
+} -test {
+ faultsim_test_result {0 {hello world}}
+ catch { close $::blob }
+}
+
+finish_test
+
« no previous file with comments | « third_party/sqlite/src/test/incrblob3.test ('k') | third_party/sqlite/src/test/incrvacuum.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698