Update tests in returning1.test to account for [c7896e88].
[sqlite.git] / ext / rbu / rbuvacuum3.test
blobd70c094f2fff41e15130bf6431522d76426bf67d
1 # 2019 Jan 3
3 # The author disclaims copyright to this source code.  In place of
4 # a legal notice, here is a blessing:
6 #    May you do good and not evil.
7 #    May you find forgiveness for yourself and forgive others.
8 #    May you share freely, never taking more than you give.
10 #***********************************************************************
12 # This file contains tests for the RBU module. More specifically, it
13 # contains tests to ensure that the sqlite3rbu_vacuum() API works as
14 # expected.
17 source [file join [file dirname [info script]] rbu_common.tcl]
18 if_no_rbu_support { finish_test ; return }
19 set testprefix rbuvacuum3
21 do_execsql_test 1.0 {
22   CREATE TABLE t1(a PRIMARY KEY, b, c);
23   CREATE INDEX i1b ON t1(b);
24   CREATE INDEX i1c ON t1(c);
25   
26   WITH s(i) AS (
27     VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<100
28   )
29   INSERT INTO t1 SELECT i, randomblob(100), randomblob(100) FROM s;
32 forcedelete state.db
33 do_test 1.1 {
34   sqlite3rbu_vacuum rbu test.db state.db
35   while {1} {
36     set rc [rbu step]
37     if {$rc!="SQLITE_OK"} break
38     rbu savestate
39   }
40   rbu close
41 } {SQLITE_DONE}
43 do_test 1.2 {
44   sqlite3rbu_vacuum rbu test.db state.db
45   while {1} {
46     set rc [rbu step]
47     if {$rc!="SQLITE_OK"} break
48     rbu savestate
49   }
50   rbu close
51 } {SQLITE_DONE}
53 do_test 1.3 {
54   while {1} {
55     sqlite3rbu_vacuum rbu test.db state.db
56     set rc [rbu step]
57     if {$rc!="SQLITE_OK"} break
58     rbu savestate
59     rbu close
60   }
61   rbu close
62 } {SQLITE_DONE}
64 finish_test