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

Unified Diff: third_party/sqlite/src/test/hook.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/fuzzer1.test ('k') | third_party/sqlite/src/test/icu.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/hook.test
diff --git a/third_party/sqlite/src/test/hook.test b/third_party/sqlite/src/test/hook.test
index b526708e0d49028d2b50926db58f94989753910f..6496d41e137bbaf909967c7d5fc2876657411bb2 100644
--- a/third_party/sqlite/src/test/hook.test
+++ b/third_party/sqlite/src/test/hook.test
@@ -334,4 +334,31 @@ do_test hook-5.2.2 {
# End rollback-hook testing.
#----------------------------------------------------------------------------
+#----------------------------------------------------------------------------
+# Test that if a commit-hook returns non-zero (causing a rollback), the
+# rollback-hook is invoked.
+#
+proc commit_hook {} {
+ lappend ::hooks COMMIT
+ return 1
+}
+proc rollback_hook {} {
+ lappend ::hooks ROLLBACK
+}
+do_test hook-6.1 {
+ set ::hooks [list]
+ db commit_hook commit_hook
+ db rollback_hook rollback_hook
+ catchsql {
+ BEGIN;
+ INSERT INTO t1 VALUES('two', 'II');
+ COMMIT;
+ }
+ execsql { SELECT * FROM t1 }
+} {one I}
+do_test hook-6.2 {
+ set ::hooks
+} {COMMIT ROLLBACK}
+unset ::hooks
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/fuzzer1.test ('k') | third_party/sqlite/src/test/icu.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698