More testing (CVS 209)

FossilOrigin-Name: 3bde128418fe70a2fd62bf9e013999827a16053c
This commit is contained in:
drh 2001-04-12 23:21:58 +00:00
parent ed7c855cdd
commit d400728ac1
8 changed files with 208 additions and 29 deletions

View File

@ -1,5 +1,5 @@
C :-)\s(CVS\s208) C More\stesting\s(CVS\s209)
D 2001-04-11T14:29:22 D 2001-04-12T23:21:59
F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
F Makefile.in 4775f7fd1ed543606bb24fa3fada1bc90a23a6b9 F Makefile.in 4775f7fd1ed543606bb24fa3fada1bc90a23a6b9
F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
@ -45,7 +45,7 @@ F src/util.c 1b396ac34e30dd6222d82e996c17b161bbc906bc
F src/vdbe.c ee5a6ab95c8c84497f6685ebde153da6fb06e825 F src/vdbe.c ee5a6ab95c8c84497f6685ebde153da6fb06e825
F src/vdbe.h dc1205da434c6a9da03b5d6b089270bbc8e6d437 F src/vdbe.h dc1205da434c6a9da03b5d6b089270bbc8e6d437
F src/where.c 0c542fc44bd85152dfb8507862cfe2e60c629e9f F src/where.c 0c542fc44bd85152dfb8507862cfe2e60c629e9f
F test/all.test 4ba0807feec7f29bf90c4f0ffd10b3801634461d F test/all.test 21d55a97e39e7ec5776751dc9dd8b1b51ef4a048
F test/copy.test b77a1214bd7756f2849d5c4fa6e715c0ff0c34eb F test/copy.test b77a1214bd7756f2849d5c4fa6e715c0ff0c34eb
F test/dbbe.test a022fe2d983848f786e17ef1fc6809cfd37fb02c F test/dbbe.test a022fe2d983848f786e17ef1fc6809cfd37fb02c
F test/delete.test 50b9b1f06c843d591741dba7869433a105360dbf F test/delete.test 50b9b1f06c843d591741dba7869433a105360dbf
@ -57,21 +57,21 @@ F test/insert.test dbd3bd189edb61fddbe66c236694ef23352429f1
F test/insert2.test 732405e30331635af8d159fccabe835eea5cd0c6 F test/insert2.test 732405e30331635af8d159fccabe835eea5cd0c6
F test/lock.test bca7d53de73138b1f670a2fbdb1f481ff7eaa45a F test/lock.test bca7d53de73138b1f670a2fbdb1f481ff7eaa45a
F test/main.test da635f9e078cd21ddf074e727381a715064489ff F test/main.test da635f9e078cd21ddf074e727381a715064489ff
F test/malloc.test 47777dd5697c43f575d6a898b6b3f332f10a71d3 F test/malloc.test 3daa97f6a9577d8f4c6e468b274333af19ce5861
F test/printf.test 4c71871e1a75a2dacb673945fc13ddb30168798f F test/printf.test 4c71871e1a75a2dacb673945fc13ddb30168798f
F test/rowid.test 128453599def7435e988216f7fe89c7450b8a9a3 F test/rowid.test 128453599def7435e988216f7fe89c7450b8a9a3
F test/select1.test 824d9d5007dffd6a45edde79e89c0a04c36e3ebe F test/select1.test 223507655cdb4f9901d83fa7f5c5328e022c211f
F test/select2.test 04ac3bd69298f58c7d0883159bab42ab9ad6021c F test/select2.test 04ac3bd69298f58c7d0883159bab42ab9ad6021c
F test/select3.test a9234b8424b6c6d71de534f43b91ade9be68e9cc F test/select3.test a9234b8424b6c6d71de534f43b91ade9be68e9cc
F test/select4.test cb5374d7c87680e294ac749307459a5cc547609d F test/select4.test cb5374d7c87680e294ac749307459a5cc547609d
F test/select5.test e2b9d51d88cbd6c307c2c05b0ef55fe7ba811ac2 F test/select5.test e2b9d51d88cbd6c307c2c05b0ef55fe7ba811ac2
F test/sort.test 838cd862642ed9a2c47e1a17b5c33da452b4552e F test/sort.test 838cd862642ed9a2c47e1a17b5c33da452b4552e
F test/subselect.test bf8b251a92fb091973c1c469ce499dc9648a41d5 F test/subselect.test bf8b251a92fb091973c1c469ce499dc9648a41d5
F test/table.test c1704fead1af27d67850a934d531848ce5bee4a7 F test/table.test 3e0d74ec03f3df167544d63f39b9b6cd6d1d1273
F test/tableapi.test 4778414470ba150983d03b9858334effe720c2e0 F test/tableapi.test 4778414470ba150983d03b9858334effe720c2e0
F test/tclsqlite.test d2aa55926874783b2401f0146e839f773c6796e1 F test/tclsqlite.test d2aa55926874783b2401f0146e839f773c6796e1
F test/tester.tcl 39a707dac2b6048d9c9e07a98d3256d50069fe47 F test/tester.tcl 39a707dac2b6048d9c9e07a98d3256d50069fe47
F test/trans.test 82556605d48f56ad4679e95478d70546a763f26a F test/trans.test 51e50e8273da6845b31a2095e9d3b221fb60d8d0
F test/update.test 72c0c93310483b86dc904a992220c5b84c7ce100 F test/update.test 72c0c93310483b86dc904a992220c5b84c7ce100
F test/vacuum.test b95d8119a0a83dc6c4ac63888f8872f06199e065 F test/vacuum.test b95d8119a0a83dc6c4ac63888f8872f06199e065
F test/where.test bbab5a308055fb6087dc23d600b4ad2b72797397 F test/where.test bbab5a308055fb6087dc23d600b4ad2b72797397
@ -88,7 +88,7 @@ F www/arch.fig 4f246003b7da23bd63b8b0af0618afb4ee3055c8
F www/arch.png 8dae0766d42ed3de9ed013c1341a5792bcf633e6 F www/arch.png 8dae0766d42ed3de9ed013c1341a5792bcf633e6
F www/arch.tcl a40380c1fe0080c43e6cc5c20ed70731511b06be F www/arch.tcl a40380c1fe0080c43e6cc5c20ed70731511b06be
F www/c_interface.tcl ddca19005c47dd5a15882addc02fff5de83d8ed9 F www/c_interface.tcl ddca19005c47dd5a15882addc02fff5de83d8ed9
F www/changes.tcl cad714ae8d6e5c19e8d14282dbfbe7c61c5cc4ee F www/changes.tcl e89e31b688833f6393dc1add45e3b4bd1da966b8
F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e
F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c
F www/fileformat.tcl cfb7fba80b7275555281ba2f256c00734bcdd1c9 F www/fileformat.tcl cfb7fba80b7275555281ba2f256c00734bcdd1c9
@ -99,7 +99,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f
F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f
F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2 F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2
F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad
P 86b30cd0975dfea9424b9f9f0d4194aa71ce508b P 555351dd1918f96167e2cb46cc1db6496e8d10a3
R 446c442a007e555210ed8cb182f64479 R 88f43cdb122b3ed28d135a7a6386c93b
U drh U drh
Z 9bc3b137c004e3bfdf49c47f3fac4875 Z f62bd098004466e47e342be3c2445c9d

View File

@ -1 +1 @@
555351dd1918f96167e2cb46cc1db6496e8d10a3 3bde128418fe70a2fd62bf9e013999827a16053c

View File

@ -22,7 +22,7 @@
#*********************************************************************** #***********************************************************************
# This file runs all tests. # This file runs all tests.
# #
# $Id: all.test,v 1.6 2001/04/11 14:28:43 drh Exp $ # $Id: all.test,v 1.7 2001/04/12 23:21:59 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -32,7 +32,7 @@ proc finish_test {} {memleak_check}
if {[file exists ./sqlite_test_count]} { if {[file exists ./sqlite_test_count]} {
set COUNT [exec cat ./sqlite_test_count] set COUNT [exec cat ./sqlite_test_count]
} else { } else {
set COUNT 4 set COUNT 3
} }
if {[file exists ./sqlite_test_prefixes]} { if {[file exists ./sqlite_test_prefixes]} {
@ -81,12 +81,10 @@ if {$LeakList!=""} {
} }
if {[file readable $testdir/malloc.test]} { if {[file readable $testdir/malloc.test]} {
for {set Counter 0} {$Counter<$COUNT} {incr Counter} {
foreach p $PREFIXES { foreach p $PREFIXES {
set dbprefix $p set dbprefix $p
source $testdir/malloc.test source $testdir/malloc.test
} }
} }
}
really_finish_test really_finish_test

View File

@ -26,7 +26,7 @@
# special feature is used to see what happens in the library if a malloc # special feature is used to see what happens in the library if a malloc
# were to really fail due to an out-of-memory situation. # were to really fail due to an out-of-memory situation.
# #
# $Id: malloc.test,v 1.1 2001/04/11 14:29:22 drh Exp $ # $Id: malloc.test,v 1.2 2001/04/12 23:21:59 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -53,7 +53,7 @@ for {set go 1; set i 1} {$go} {incr i} {
INSERT INTO t1 VALUES(1,2.3,4.5,'hi','there'); INSERT INTO t1 VALUES(1,2.3,4.5,'hi','there');
INSERT INTO t1 VALUES(6,7.0,0.8,'hello','out yonder'); INSERT INTO t1 VALUES(6,7.0,0.8,'hello','out yonder');
SELECT * FROM t1; SELECT * FROM t1;
SELECT avg(b) FROM t1 GROUP BY a; SELECT avg(b) FROM t1 GROUP BY a HAVING b>20.0;
DELETE FROM t1 WHERE a==6; DELETE FROM t1 WHERE a==6;
SELECT count(*) FROM t1; SELECT count(*) FROM t1;
}} msg] }} msg]
@ -65,5 +65,34 @@ for {set go 1; set i 1} {$go} {incr i} {
} }
} {1 1} } {1 1}
} }
set fd [open ./data.tmp w]
for {set i 1} {$i<=40} {incr i} {
puts $fd "$i\t[expr {$i*$i}]\t[expr {100-$i}]"
}
close $fd
for {set go 1; set i 1} {$go} {incr i} {
do_test malloc-2.$i {
sqlite_malloc_fail 0
catch {execsql {DROP TABLE t1}}
sqlite_malloc_fail $i
set v [catch {execsql {
CREATE TABLE t1(a int, b int, c int);
CREATE INDEX i1 ON t1(a,b);
COPY t1 FROM 'data.tmp';
SELECT 'stuff', count(*) as 'other stuff' FROM t1;
UPDATE t1 SET b=a WHERE a in (10,12,22);
DROP INDEX i1;
VACUUM t1;
}} msg]
if {[lindex [sqlite_malloc_stat] 2]>0} {
set ::go 0
set v {1 1}
} else {
lappend v [expr {$msg=="" || $msg=="out of memory"}]
}
} {1 1}
}
sqlite_malloc_fail 0 sqlite_malloc_fail 0
finish_test finish_test

View File

@ -23,7 +23,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the SELECT statement. # focus of this file is testing the SELECT statement.
# #
# $Id: select1.test,v 1.8 2001/04/04 11:48:58 drh Exp $ # $Id: select1.test,v 1.9 2001/04/12 23:21:59 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -258,6 +258,10 @@ do_test select1-6.3 {
set v [catch {execsql2 {SELECT f1 as "xyzzy" FROM test1 ORDER BY f2}} msg] set v [catch {execsql2 {SELECT f1 as "xyzzy" FROM test1 ORDER BY f2}} msg]
lappend v $msg lappend v $msg
} {0 {xyzzy 11 xyzzy 33}} } {0 {xyzzy 11 xyzzy 33}}
do_test select1-6.3.1 {
set v [catch {execsql2 {SELECT f1 as 'xyzzy ' FROM test1 ORDER BY f2}} msg]
lappend v $msg
} {0 {{xyzzy } 11 {xyzzy } 33}}
do_test select1-6.4 { do_test select1-6.4 {
set v [catch {execsql2 {SELECT f1+F2 as xyzzy FROM test1 ORDER BY f2}} msg] set v [catch {execsql2 {SELECT f1+F2 as xyzzy FROM test1 ORDER BY f2}} msg]
lappend v $msg lappend v $msg
@ -315,4 +319,79 @@ do_test select1-6.11 {
lappend v $msg lappend v $msg
} {0 {f2+100 11 f2+100 33 f2+100 122 f2+100 144}} } {0 {f2+100 11 f2+100 33 f2+100 122 f2+100 144}}
do_test select1-7.1 {
set v [catch {execsql {
SELECT f1 FROM test1 WHERE f2=;
}} msg]
lappend v $msg
} {1 {near ";": syntax error}}
do_test select1-7.2 {
set v [catch {execsql {
SELECT f1 FROM test1 UNION SELECT WHERE;
}} msg]
lappend v $msg
} {1 {near "WHERE": syntax error}}
do_test select1-7.3 {
set v [catch {execsql {SELECT f1 FROM test1 as 'hi', test2 as}} msg]
lappend v $msg
} {1 {near "as": syntax error}}
do_test select1-7.4 {
set v [catch {execsql {
SELECT f1 FROM test1 ORDER BY;
}} msg]
lappend v $msg
} {1 {near ";": syntax error}}
do_test select1-7.5 {
set v [catch {execsql {
SELECT f1 FROM test1 ORDER BY f1 desc, f2 where;
}} msg]
lappend v $msg
} {1 {near "where": syntax error}}
do_test select1-7.6 {
set v [catch {execsql {
SELECT count(f1,f2 FROM test1;
}} msg]
lappend v $msg
} {1 {near "FROM": syntax error}}
do_test select1-7.7 {
set v [catch {execsql {
SELECT count(f1,f2+) FROM test1;
}} msg]
lappend v $msg
} {1 {near ")": syntax error}}
do_test select1-7.8 {
set v [catch {execsql {
SELECT f1 FROM test1 ORDER BY f2, f1+;
}} msg]
lappend v $msg
} {1 {near ";": syntax error}}
do_test select1-8.1 {
execsql {SELECT f1 FROM test1 WHERE 4.3+2.4 OR 1 ORDER BY f1}
} {11 33}
do_test select1-8.2 {
execsql {
SELECT f1 FROM test1 WHERE ('x' || f1) BETWEEN 'x10' AND 'x20'
ORDER BY f1
}
} {11}
do_test select1-8.3 {
execsql {
SELECT f1 FROM test1 WHERE 5-3==2
ORDER BY f1
}
} {11 33}
do_test select1-8.4 {
execsql {
SELECT f1/(f1-11), min(f1/(f1-11),5), max(f1/(f1-33),6)
FROM test1 ORDER BY f1
}
} {{} 5 6 1.5 1.5 6}
do_test select1-8.5 {
execsql {
SELECT min(1,2,3), -max(1,2,3)
FROM test1 ORDER BY f1
}
} {1 -3 1 -3}
finish_test finish_test

View File

@ -23,7 +23,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this file is testing the CREATE TABLE statement. # focus of this file is testing the CREATE TABLE statement.
# #
# $Id: table.test,v 1.8 2001/04/04 11:48:58 drh Exp $ # $Id: table.test,v 1.9 2001/04/12 23:21:59 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -313,21 +313,23 @@ do_test table-7.1 {
asc text, asc text,
explain int, explain int,
vacuum boolean, vacuum boolean,
delimiters varchar(10) delimiters varchar(10),
begin blob,
end clob
) )
}} msg] }} msg]
lappend v $msg lappend v $msg
} {0 {}} } {0 {}}
do_test table-7.2 { do_test table-7.2 {
execsql { execsql {
INSERT INTO weird VALUES('a','b',9,0,'xyz'); INSERT INTO weird VALUES('a','b',9,0,'xyz','hi','y''all');
SELECT * FROM weird; SELECT * FROM weird;
} }
} {a b 9 0 xyz} } {a b 9 0 xyz hi y'all}
do_test table-7.3 { do_test table-7.3 {
execsql2 { execsql2 {
SELECT * FROM weird; SELECT * FROM weird;
} }
} {desc a asc b explain 9 vacuum 0 delimiters xyz} } {desc a asc b explain 9 vacuum 0 delimiters xyz begin hi end y'all}
finish_test finish_test

View File

@ -23,7 +23,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this script is database locks. # focus of this script is database locks.
# #
# $Id: trans.test,v 1.1 2001/04/04 11:48:58 drh Exp $ # $Id: trans.test,v 1.2 2001/04/12 23:21:59 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -178,6 +178,76 @@ do_test trans-3.14 {
lappend v $msg lappend v $msg
} {0 {1 2 3 4}} } {0 {1 2 3 4}}
do_test trans-4.1 {
set v [catch {execsql {
COMMIT;
} db} msg]
lappend v $msg
} {0 {}}
do_test trans-4.2 {
set v [catch {execsql {
ROLLBACK;
} db} msg]
lappend v $msg
} {0 {}}
do_test trans-4.3 {
set v [catch {execsql {
BEGIN TRANSACTION;
SELECT a FROM two ORDER BY a;
} db} msg]
lappend v $msg
} {0 {1 4 5 10}}
do_test trans-4.4 {
set v [catch {execsql {
SELECT a FROM two ORDER BY a;
} altdb} msg]
lappend v $msg
} {1 {table two is locked}}
do_test trans-4.5 {
set v [catch {execsql {
SELECT a FROM one ORDER BY a;
} altdb} msg]
lappend v $msg
} {0 {1 2 3 4}}
do_test trans-4.6 {
set v [catch {execsql {
BEGIN TRANSACTION;
SELECT a FROM one ORDER BY a;
} db} msg]
lappend v $msg
} {0 {1 2 3 4}}
do_test trans-4.7 {
set v [catch {execsql {
SELECT a FROM two ORDER BY a;
} altdb} msg]
lappend v $msg
} {1 {table two is locked}}
do_test trans-4.8 {
set v [catch {execsql {
SELECT a FROM one ORDER BY a;
} altdb} msg]
lappend v $msg
} {1 {table one is locked}}
do_test trans-4.9 {
set v [catch {execsql {
END TRANSACTION;
SELECT a FROM two ORDER BY a;
} db} msg]
lappend v $msg
} {0 {1 4 5 10}}
do_test trans-4.10 {
set v [catch {execsql {
SELECT a FROM two ORDER BY a;
} altdb} msg]
lappend v $msg
} {0 {1 4 5 10}}
do_test trans-4.11 {
set v [catch {execsql {
SELECT a FROM one ORDER BY a;
} altdb} msg]
lappend v $msg
} {0 {1 2 3 4}}
do_test trans-99.1 { do_test trans-99.1 {
altdb close altdb close
execsql { execsql {
@ -186,6 +256,7 @@ do_test trans-99.1 {
} }
} {} } {}
finish_test finish_test
} ;# end if(gdbm and not windows) } ;# end if(gdbm and not windows)

View File

@ -17,7 +17,7 @@ proc chng {date desc} {
puts "<DD><P><UL>$desc</UL></P></DD>" puts "<DD><P><UL>$desc</UL></P></DD>"
} }
chng {2001 Apr 11 (1.0.31)} { chng {2001 Apr 12 (1.0.31)} {
<li>More robust handling of out-of-memory errors.</li> <li>More robust handling of out-of-memory errors.</li>
<li>New tests added to the test suite.</li> <li>New tests added to the test suite.</li>
} }