aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/colmeta.test11
-rw-r--r--test/like.test8
-rw-r--r--test/mallocG.test16
-rw-r--r--test/misc5.test11
-rw-r--r--test/misc7.test8
-rw-r--r--test/tableapi.test21
6 files changed, 48 insertions, 27 deletions
diff --git a/test/colmeta.test b/test/colmeta.test
index c2513e6f8..3939f8228 100644
--- a/test/colmeta.test
+++ b/test/colmeta.test
@@ -12,7 +12,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is the sqlite3_table_column_metadata() API.
#
-# $Id: colmeta.test,v 1.3 2006/02/10 13:33:31 danielk1977 Exp $
+# $Id: colmeta.test,v 1.4 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -91,13 +91,4 @@ foreach {tn params results} $tests {
} $results
}
-do_test colmeta-misuse.1 {
- db close
- set rc [catch {
- sqlite3_table_column_metadata $::DB a b c
- } msg]
- list $rc $msg
-} {1 {library routine called out of sequence}}
-
finish_test
-
diff --git a/test/like.test b/test/like.test
index e154ca2e1..236529858 100644
--- a/test/like.test
+++ b/test/like.test
@@ -13,7 +13,7 @@
# in particular the optimizations that occur to help those operators
# run faster.
#
-# $Id: like.test,v 1.7 2007/09/12 17:01:45 danielk1977 Exp $
+# $Id: like.test,v 1.8 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -397,4 +397,10 @@ do_test like-6.1 {
}
} {'abc 'ax}
+do_test like-7.1 {
+ execsql {
+ SELECT * FROM t1 WHERE rowid GLOB '1*';
+ }
+} {a}
+
finish_test
diff --git a/test/mallocG.test b/test/mallocG.test
index a55cbce8d..57534feab 100644
--- a/test/mallocG.test
+++ b/test/mallocG.test
@@ -11,7 +11,7 @@
#
# This test script checks malloc failures in various obscure operations.
#
-# $Id: mallocG.test,v 1.1 2008/01/22 01:48:09 drh Exp $
+# $Id: mallocG.test,v 1.2 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -39,4 +39,18 @@ do_malloc_test mallocG-2 -sqlprep {
SELECT y FROM t1 WHERE x IN t2;
}
+do_malloc_test mallocG-3 -sqlprep {
+ CREATE TABLE t1(x UNIQUE);
+ INSERT INTO t1 VALUES ('hello');
+ INSERT INTO t1 VALUES ('out there');
+} -sqlbody {
+ SELECT * FROM t1
+ WHERE x BETWEEN 'a' AND 'z'
+ AND x BETWEEN 'c' AND 'w'
+ AND x BETWEEN 'e' AND 'u'
+ AND x BETWEEN 'g' AND 'r'
+ AND x BETWEEN 'i' AND 'q'
+ AND x BETWEEN 'i' AND 'm'
+}
+
finish_test
diff --git a/test/misc5.test b/test/misc5.test
index ebccf4c0a..f6d7c91e4 100644
--- a/test/misc5.test
+++ b/test/misc5.test
@@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
-# $Id: misc5.test,v 1.19 2007/12/13 07:58:51 danielk1977 Exp $
+# $Id: misc5.test,v 1.20 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -581,15 +581,6 @@ do_test misc5-7.1 {
catchsql $sql
} {1 {parser stack overflow}}
-# Check the MISUSE return from sqlitee3_busy_timeout
-#
-do_test misc5-8.1-misuse {
- set DB [sqlite3_connection_pointer db]
- db close
- sqlite3_busy_timeout $DB 1000
-} SQLITE_MISUSE
-sqlite3 db test.db
-
# Ticket #1911
#
ifcapable compound {
diff --git a/test/misc7.test b/test/misc7.test
index a7964a10c..c683116a0 100644
--- a/test/misc7.test
+++ b/test/misc7.test
@@ -10,14 +10,14 @@
#***********************************************************************
# This file implements regression tests for SQLite library.
#
-# $Id: misc7.test,v 1.17 2007/12/13 21:54:11 drh Exp $
+# $Id: misc7.test,v 1.18 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
-#do_test misc7-1 {
-# c_misuse_test
-#} {}
+do_test misc7-1-misuse {
+ c_misuse_test
+} {}
do_test misc7-2 {
c_realloc_test
diff --git a/test/tableapi.test b/test/tableapi.test
index 1738291af..327e9e35e 100644
--- a/test/tableapi.test
+++ b/test/tableapi.test
@@ -12,7 +12,7 @@
# focus of this file is testing the sqlite_exec_printf() and
# sqlite_get_table_printf() APIs.
#
-# $Id: tableapi.test,v 1.13 2007/09/12 17:01:45 danielk1977 Exp $
+# $Id: tableapi.test,v 1.14 2008/01/23 12:52:41 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -61,6 +61,11 @@ do_test tableapi-2.3.2 {
SELECT * FROM xyz WHERE a>47 ORDER BY a
} {}
} {0 3 2 a b 48 (48) 49 (49) 50 (50)}
+do_test tableapi-2.3.3 {
+ sqlite3_get_table_printf $::dbx {
+ SELECT * FROM xyz WHERE a>47 ORDER BY a; invalid
+ } {}
+} {1 {near "invalid": syntax error}}
do_test tableapi-2.4 {
set manyquote ''''''''
append manyquote $manyquote
@@ -212,6 +217,20 @@ ifcapable schema_pragmas {
} {0 1 1 user_version 0}
}
+ifcapable memdebug {
+ source $testdir/malloc_common.tcl
+ do_malloc_test tableapi-7 -sqlprep {
+ CREATE TABLE t1(a,b);
+ INSERT INTO t1 VALUES(1,2);
+ INSERT INTO t1 VALUES(3,4);
+ INSERT INTO t1 SELECT a+4, b+4 FROM t1;
+ INSERT INTO t1 SELECT a+8, b+8 FROM t1;
+ } -tclbody {
+ set r [sqlite3_get_table_printf db {SELECT rowid, a, b FROM t1} {}]
+ if {[llength $r]<26} {error "out of memory"}
+ }
+}
+
do_test tableapi-99.0 {
sqlite3_close $::dbx
} {SQLITE_OK}