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

Unified Diff: third_party/sqlite/src/test/func3.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/func2.test ('k') | third_party/sqlite/src/test/fuzz.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/func3.test
diff --git a/third_party/sqlite/src/test/func3.test b/third_party/sqlite/src/test/func3.test
new file mode 100644
index 0000000000000000000000000000000000000000..e58d730f3a32410d9375f792e7dbc8c1d540b60f
--- /dev/null
+++ b/third_party/sqlite/src/test/func3.test
@@ -0,0 +1,71 @@
+# 2010 August 27
+#
+# 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.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library. The
+# focus of this file is testing that destructor functions associated
+# with functions created using sqlite3_create_function_v2() is
+# correctly invoked.
+#
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+
+do_test func3-1.1 {
+ set destroyed 0
+ proc destroy {} { set ::destroyed 1 }
+ sqlite3_create_function_v2 db f2 -1 any -func f2 -destroy destroy
+ set destroyed
+} 0
+do_test func3-1.2 {
+ sqlite3_create_function_v2 db f2 -1 utf8 -func f2
+ set destroyed
+} 0
+do_test func3-1.3 {
+ sqlite3_create_function_v2 db f2 -1 utf16le -func f2
+ set destroyed
+} 0
+do_test func3-1.4 {
+ sqlite3_create_function_v2 db f2 -1 utf16be -func f2
+ set destroyed
+} 1
+
+do_test func3-2.1 {
+ set destroyed 0
+ proc destroy {} { set ::destroyed 1 }
+ sqlite3_create_function_v2 db f3 -1 utf8 -func f3 -destroy destroy
+ set destroyed
+} 0
+do_test func3-2.2 {
+ sqlite3_create_function_v2 db f3 -1 utf8 -func f3
+ set destroyed
+} 1
+
+do_test func3-3.1 {
+ set destroyed 0
+ proc destroy {} { set ::destroyed 1 }
+ sqlite3_create_function_v2 db f3 -1 any -func f3 -destroy destroy
+ set destroyed
+} 0
+do_test func3-3.2 {
+ db close
+ set destroyed
+} 1
+
+sqlite3 db test.db
+do_test func3-4.1 {
+ set destroyed 0
+ set rc [catch {
+ sqlite3_create_function_v2 db f3 -1 any -func f3 -step f3 -destroy destroy
+ } msg]
+ list $rc $msg
+} {1 SQLITE_MISUSE}
+do_test func3-4.2 { set destroyed } 1
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/func2.test ('k') | third_party/sqlite/src/test/fuzz.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698