summaryrefslogtreecommitdiffstats
path: root/ext/rbu/rbuB.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:28:19 +0000
commit18657a960e125336f704ea058e25c27bd3900dcb (patch)
tree17b438b680ed45a996d7b59951e6aa34023783f2 /ext/rbu/rbuB.test
parentInitial commit. (diff)
downloadsqlite3-18657a960e125336f704ea058e25c27bd3900dcb.tar.xz
sqlite3-18657a960e125336f704ea058e25c27bd3900dcb.zip
Adding upstream version 3.40.1.upstream/3.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ext/rbu/rbuB.test')
-rw-r--r--ext/rbu/rbuB.test61
1 files changed, 61 insertions, 0 deletions
diff --git a/ext/rbu/rbuB.test b/ext/rbu/rbuB.test
new file mode 100644
index 0000000..ece51c3
--- /dev/null
+++ b/ext/rbu/rbuB.test
@@ -0,0 +1,61 @@
+# 2014 August 30
+#
+# 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.
+#
+#***********************************************************************
+#
+#
+
+source [file join [file dirname [info script]] rbu_common.tcl]
+set ::testprefix rbuB
+
+db close
+sqlite3_shutdown
+test_sqlite3_log xLog
+reset_db
+
+proc xLog {args} { }
+
+set db_sql {
+ CREATE TABLE t1(a PRIMARY KEY, b, c);
+}
+set rbu_sql {
+ CREATE TABLE data_t1(a, b, c, rbu_control);
+ INSERT INTO data_t1 VALUES(1, 2, 3, 0);
+ INSERT INTO data_t1 VALUES(4, 5, 6, 0);
+ INSERT INTO data_t1 VALUES(7, 8, 9, 0);
+}
+
+do_test 1.1 {
+ forcedelete rbu.db
+ sqlite3 rbu rbu.db
+ rbu eval $rbu_sql
+ rbu close
+
+ db eval $db_sql
+} {}
+
+set ::errlog [list]
+proc xLog {err msg} { lappend ::errlog $err }
+do_test 1.2 {
+ run_rbu test.db rbu.db
+} {SQLITE_DONE}
+
+do_test 1.3 {
+ set ::errlog
+} {SQLITE_NOTICE_RECOVER_WAL SQLITE_INTERNAL}
+
+do_execsql_test 1.4 {
+ SELECT * FROM t1
+} {1 2 3 4 5 6 7 8 9}
+
+db close
+sqlite3_shutdown
+test_sqlite3_log
+sqlite3_initialize
+finish_test