summaryrefslogtreecommitdiff
path: root/components/external/SQLite-3.8.1/test/backup4.test
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-11-02 13:50:42 +0800
committerbernard <[email protected]>2017-11-02 13:50:42 +0800
commitb2057f506a09e2adef81fc77efd697d16ae14bec (patch)
tree3affefabfe376a0ec1b3ac4a5eef957c1dd58dc8 /components/external/SQLite-3.8.1/test/backup4.test
parent23582c8129228b4961ad35319cfd2d270039345f (diff)
[External] Remove external from RT-Thread
Diffstat (limited to 'components/external/SQLite-3.8.1/test/backup4.test')
-rw-r--r--components/external/SQLite-3.8.1/test/backup4.test103
1 files changed, 0 insertions, 103 deletions
diff --git a/components/external/SQLite-3.8.1/test/backup4.test b/components/external/SQLite-3.8.1/test/backup4.test
deleted file mode 100644
index 417df80e55..0000000000
--- a/components/external/SQLite-3.8.1/test/backup4.test
+++ /dev/null
@@ -1,103 +0,0 @@
-# 2012 October 13
-#
-# 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.
-#
-#***********************************************************************
-#
-# The tests in this file verify that if an empty database (zero bytes in
-# size) is used as the source of a backup operation, the final destination
-# database is one page in size.
-#
-# The destination must consist of at least one page as truncating a
-# database file to zero bytes is equivalent to resetting the database
-# schema cookie and change counter. Doing that could cause other clients
-# to become confused and continue using out-of-date cache data.
-#
-
-set testdir [file dirname $argv0]
-source $testdir/tester.tcl
-set testprefix backup4
-
-#-------------------------------------------------------------------------
-# At one point this test was failing because [db] was using an out of
-# date schema in test case 1.2.
-#
-do_execsql_test 1.0 {
- CREATE TABLE t1(x, y, UNIQUE(x, y));
- INSERT INTO t1 VALUES('one', 'two');
- SELECT * FROM t1 WHERE x='one';
- PRAGMA integrity_check;
-} {one two ok}
-
-do_test 1.1 {
- sqlite3 db1 :memory:
- db1 backup test.db
- sqlite3 db1 test.db
- db1 eval {
- CREATE TABLE t1(x, y);
- INSERT INTO t1 VALUES('one', 'two');
- }
- db1 close
-} {}
-
-do_execsql_test 1.2 {
- SELECT * FROM t1 WHERE x='one';
- PRAGMA integrity_check;
-} {one two ok}
-
-db close
-forcedelete test.db
-forcedelete test.db2
-sqlite3 db test.db
-
-#-------------------------------------------------------------------------
-# Test that if the source is zero bytes, the destination database
-# consists of a single page only.
-#
-do_execsql_test 2.1 {
- CREATE TABLE t1(a, b);
- CREATE INDEX i1 ON t1(a, b);
-}
-do_test 2.2 { file size test.db } [expr $AUTOVACUUM ? 4096 : 3072]
-
-do_test 2.3 {
- sqlite3 db1 test.db2
- db1 backup test.db
- db1 close
- file size test.db
-} {1024}
-
-do_test 2.4 { file size test.db2 } 0
-
-db close
-forcedelete test.db
-forcedelete test.db2
-sqlite3 db test.db
-
-#-------------------------------------------------------------------------
-# Test that if the destination has a page-size larger than the implicit
-# page-size of the source, the final destination database still consists
-# of a single page.
-#
-do_execsql_test 3.1 {
- PRAGMA page_size = 4096;
- CREATE TABLE t1(a, b);
- CREATE INDEX i1 ON t1(a, b);
-}
-do_test 3.2 { file size test.db } [expr $AUTOVACUUM ? 16384 : 12288]
-
-do_test 3.3 {
- sqlite3 db1 test.db2
- db1 backup test.db
- db1 close
- file size test.db
-} {1024}
-
-do_test 3.4 { file size test.db2 } 0
-
-finish_test