Test coverage improvements. Over 90% of branches are now executed in

both directions. (CVS 3820)

FossilOrigin-Name: a776d93ccae3bfa6e992cdd1387571dd21561f98
This commit is contained in:
drh 2007-04-06 02:32:33 +00:00
parent 77a2a5e73c
commit 05f7c19a6e
7 changed files with 52 additions and 20 deletions

View File

@ -1,5 +1,5 @@
C Changes\sto\sincrease\stest\scoverage.\s(CVS\s3819) C Test\scoverage\simprovements.\s\sOver\s90%\sof\sbranches\sare\snow\sexecuted\sin\nboth\sdirections.\s(CVS\s3820)
D 2007-04-06T01:04:40 D 2007-04-06T02:32:34
F Makefile.in a9bd493360a2b17e5214b69d8c32dd6cdaceaf55 F Makefile.in a9bd493360a2b17e5214b69d8c32dd6cdaceaf55
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -63,7 +63,7 @@ F src/btree.h 9b2cc0d113c0bc2d37d244b9a394d56948c9acbf
F src/build.c 7c2efa468f0c404ef5aa648d43c383318390937f F src/build.c 7c2efa468f0c404ef5aa648d43c383318390937f
F src/callback.c 31d22b4919c7645cbcbb1591ce2453e8c677c558 F src/callback.c 31d22b4919c7645cbcbb1591ce2453e8c677c558
F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675 F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
F src/date.c c4930ef6afc2e9de12d51f800a8f750fac5ddb42 F src/date.c 74b76691bddf58b634f6bf4a77c8c58234268c6e
F src/delete.c 151d08386bf9c9e7f92f6b9106c71efec2def184 F src/delete.c 151d08386bf9c9e7f92f6b9106c71efec2def184
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
F src/expr.c a8740c24af3f39f2d502be1a1c640c96435eaac0 F src/expr.c a8740c24af3f39f2d502be1a1c640c96435eaac0
@ -121,7 +121,7 @@ F src/tokenize.c bb1732ef2b6fc2143f93ff28a45d3dcb04c1d396
F src/trigger.c b3c22b727049fceb96efa5f9f7d325fd853acc22 F src/trigger.c b3c22b727049fceb96efa5f9f7d325fd853acc22
F src/update.c 3359041db390a8f856d67272f299600e2104f350 F src/update.c 3359041db390a8f856d67272f299600e2104f350
F src/utf.c e64a48bc21aa973eb622dd47da87d56a4cdcf528 F src/utf.c e64a48bc21aa973eb622dd47da87d56a4cdcf528
F src/util.c 0102b6257c94b0a3734fb613a4c0ffd16f73ef2a F src/util.c b6344325378e75b9e18175d8b6aed1723d73dad9
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
F src/vdbe.c 87e31f0790ac8a5aad7b7fcd5b97948943fccba3 F src/vdbe.c 87e31f0790ac8a5aad7b7fcd5b97948943fccba3
F src/vdbe.h 0025259af1939fb264a545816c69e4b5b8d52691 F src/vdbe.h 0025259af1939fb264a545816c69e4b5b8d52691
@ -135,7 +135,7 @@ F src/where.c fce0dad6b230eb7ea844e8b8667c074d07e3fdd5
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/all.test 6a03095322e93427a3677ce5daaa20f45640d1f0 F test/all.test 6a03095322e93427a3677ce5daaa20f45640d1f0
F test/alter.test a2cc30e844cb3b5d203416962f56f78fc11b1978 F test/alter.test 6a956625399c83392671da690f44257a4ccf058b
F test/alter2.test 33fb74e0470455ed6903f8d6e63256c7402cebb1 F test/alter2.test 33fb74e0470455ed6903f8d6e63256c7402cebb1
F test/alter3.test a6eec8f454be9b6ce73d8d7dc711453675a10ce7 F test/alter3.test a6eec8f454be9b6ce73d8d7dc711453675a10ce7
F test/altermalloc.test 19323e0f452834044c27a54c6e78554d706de7ba F test/altermalloc.test 19323e0f452834044c27a54c6e78554d706de7ba
@ -188,7 +188,7 @@ F test/corrupt2.test 572f8df0303d0ce63ddad5c5c9101a83a345ae46
F test/crash.test 167eb4652eccbedb199b6f21850346c3f5d779fb F test/crash.test 167eb4652eccbedb199b6f21850346c3f5d779fb
F test/crash2.test ccc7d5f202aeadc3c13003829e6bb6561129f419 F test/crash2.test ccc7d5f202aeadc3c13003829e6bb6561129f419
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
F test/date.test bc3c390d55744649c086d5a090a1b5f00eab10a9 F test/date.test 09786cf0145147014867d822224b9bced2012b61
F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb
F test/delete.test 525a6953bc3978780cae35f3eaf1027cf4ce887d F test/delete.test 525a6953bc3978780cae35f3eaf1027cf4ce887d
F test/delete2.test c06be3806ba804bc8c6f134476816080280b40e3 F test/delete2.test c06be3806ba804bc8c6f134476816080280b40e3
@ -204,7 +204,7 @@ F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030
F test/exclusive.test 6748eb0539c4652d596971584c50200729e57dbe F test/exclusive.test 6748eb0539c4652d596971584c50200729e57dbe
F test/exclusive2.test 8d580e5bb8d49fde59fe1142543b7da081f28d06 F test/exclusive2.test 8d580e5bb8d49fde59fe1142543b7da081f28d06
F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff F test/exclusive3.test 0e49c35b7e7cb8e7280b4ce3f0359d30b207d2ff
F test/expr.test c78843f730ccbe973d0c2ad1c99978f936893131 F test/expr.test ab21e2fc3613595131efd7d8bbca4b95ed5cc608
F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce
F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc
F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7 F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7
@ -451,7 +451,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P bebf8d2f886ed9fe1b96e4cb11ab3de2f2f7d2c8 P fd4da6b13499af2397d52cb0f25f8ff6f2192431
R 25d3c5591ddd0c4ab2f7e78f9cd27746 R 5a55920740a7f85f192df0463d983c9f
U drh U drh
Z 0b6a3c115517eee9d157a43932195b4f Z 452d3f0ac4ca6ed1e1c77157a1d42b7d

View File

@ -1 +1 @@
fd4da6b13499af2397d52cb0f25f8ff6f2192431 a776d93ccae3bfa6e992cdd1387571dd21561f98

View File

@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope. ** All other code has file scope.
** **
** $Id: date.c,v 1.61 2007/03/29 17:57:21 drh Exp $ ** $Id: date.c,v 1.62 2007/04/06 02:32:34 drh Exp $
** **
** NOTES: ** NOTES:
** **
@ -577,7 +577,7 @@ static int parseModifier(const char *zMod, DateTime *p){
case '8': case '8':
case '9': { case '9': {
n = getValue(z, &r); n = getValue(z, &r);
if( n<=0 ) break; assert( n>=1 );
if( z[n]==':' ){ if( z[n]==':' ){
/* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the
** specified number of hours, minutes, seconds, and fractional seconds ** specified number of hours, minutes, seconds, and fractional seconds

View File

@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing ** This file contains functions for allocating memory, comparing
** strings, and stuff like that. ** strings, and stuff like that.
** **
** $Id: util.c,v 1.198 2007/03/31 22:33:48 drh Exp $ ** $Id: util.c,v 1.199 2007/04/06 02:32:34 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@ -751,7 +751,7 @@ void sqlite3SetString(char **pz, ...){
const char *z; const char *z;
char *zResult; char *zResult;
if( pz==0 ) return; assert( pz!=0 );
nByte = 1; nByte = 1;
va_start(ap, pz); va_start(ap, pz);
while( (z = va_arg(ap, const char*))!=0 ){ while( (z = va_arg(ap, const char*))!=0 ){

View File

@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The # This file implements regression tests for SQLite library. The
# focus of this script is testing the ALTER TABLE statement. # focus of this script is testing the ALTER TABLE statement.
# #
# $Id: alter.test,v 1.18 2007/02/24 11:52:55 drh Exp $ # $Id: alter.test,v 1.19 2007/04/06 02:32:34 drh Exp $
# #
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
@ -625,10 +625,11 @@ do_test alter-7.1 {
execsql { execsql {
CREATE TABLE t1(a TEXT COLLATE BINARY); CREATE TABLE t1(a TEXT COLLATE BINARY);
ALTER TABLE t1 ADD COLUMN b INTEGER COLLATE NOCASE; ALTER TABLE t1 ADD COLUMN b INTEGER COLLATE NOCASE;
INSERT INTO t1 VALUES(1,'2'); INSERT INTO t1 VALUES(1,'-2');
INSERT INTO t1 VALUES(5.4e-8,'5.4e-8');
SELECT typeof(a), a, typeof(b), b FROM t1; SELECT typeof(a), a, typeof(b), b FROM t1;
} }
} {text 1 integer 2} } {text 1 integer -2 text 5.4e-8 real 5.4e-08}
# Make sure that when a column is added by ALTER TABLE ADD COLUMN and has # Make sure that when a column is added by ALTER TABLE ADD COLUMN and has
# a default value that the default value is used by aggregate functions. # a default value that the default value is used by aggregate functions.

View File

@ -11,7 +11,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 date and time functions. # focus of this file is testing date and time functions.
# #
# $Id: date.test,v 1.20 2007/03/29 17:57:21 drh Exp $ # $Id: date.test,v 1.21 2007/04/06 02:32:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -61,11 +61,21 @@ datetest 1.24 {julianday('2001-01-01 12:00:00 bogus')} NULL
datetest 1.25 {julianday('2001-01-01 bogus')} NULL datetest 1.25 {julianday('2001-01-01 bogus')} NULL
datetest 1.26 {julianday('2001-01-01 12:60:00')} NULL datetest 1.26 {julianday('2001-01-01 12:60:00')} NULL
datetest 1.27 {julianday('2001-01-01 12:59:60')} NULL datetest 1.27 {julianday('2001-01-01 12:59:60')} NULL
datetest 1.28 {julianday('2001-00-01')} NULL
datetest 1.29 {julianday('2001-01-00')} NULL
datetest 2.1 datetime(0,'unixepoch') {1970-01-01 00:00:00} datetest 2.1 datetime(0,'unixepoch') {1970-01-01 00:00:00}
datetest 2.1b datetime(0,'unixepoc') NULL
datetest 2.1c datetime(0,'unixepochx') NULL
datetest 2.1d datetime('2003-10-22','unixepoch') NULL
datetest 2.2 datetime(946684800,'unixepoch') {2000-01-01 00:00:00} datetest 2.2 datetime(946684800,'unixepoch') {2000-01-01 00:00:00}
datetest 2.3 {date('2003-10-22','weekday 0')} 2003-10-26 datetest 2.3 {date('2003-10-22','weekday 0')} 2003-10-26
datetest 2.4 {date('2003-10-22','weekday 1')} 2003-10-27 datetest 2.4 {date('2003-10-22','weekday 1')} 2003-10-27
datetest 2.4a {date('2003-10-22','weekday 1')} 2003-10-27
datetest 2.4b {date('2003-10-22','weekday 1x')} 2003-10-27
datetest 2.4c {date('2003-10-22','weekday -1')} NULL
datetest 2.4d {date('2003-10-22','weakday 1x')} NULL
datetest 2.4e {date('2003-10-22','weekday ')} NULL
datetest 2.5 {date('2003-10-22','weekday 2')} 2003-10-28 datetest 2.5 {date('2003-10-22','weekday 2')} 2003-10-28
datetest 2.6 {date('2003-10-22','weekday 3')} 2003-10-22 datetest 2.6 {date('2003-10-22','weekday 3')} 2003-10-22
datetest 2.7 {date('2003-10-22','weekday 4')} 2003-10-23 datetest 2.7 {date('2003-10-22','weekday 4')} 2003-10-23
@ -80,6 +90,8 @@ datetest 2.14 {datetime('2003-10-22 12:34','start of year')} \
{2003-01-01 00:00:00} {2003-01-01 00:00:00}
datetest 2.15 {datetime('2003-10-22 12:34','start of day')} \ datetest 2.15 {datetime('2003-10-22 12:34','start of day')} \
{2003-10-22 00:00:00} {2003-10-22 00:00:00}
datetest 2.15a {datetime('2003-10-22 12:34','start of')} NULL
datetest 2.15b {datetime('2003-10-22 12:34','start of bogus')} NULL
datetest 2.16 time('12:34:56.43') 12:34:56 datetest 2.16 time('12:34:56.43') 12:34:56
datetest 2.17 {datetime('2003-10-22 12:34','1 day')} {2003-10-23 12:34:00} datetest 2.17 {datetime('2003-10-22 12:34','1 day')} {2003-10-23 12:34:00}
datetest 2.18 {datetime('2003-10-22 12:34','+1 day')} {2003-10-23 12:34:00} datetest 2.18 {datetime('2003-10-22 12:34','+1 day')} {2003-10-23 12:34:00}
@ -97,6 +109,17 @@ datetest 2.27 {datetime('2003-10-22 12:34','-1.25 hours')} \
datetest 2.28 {datetime('2003-10-22 12:34','11.25 seconds')} \ datetest 2.28 {datetime('2003-10-22 12:34','11.25 seconds')} \
{2003-10-22 12:34:11} {2003-10-22 12:34:11}
datetest 2.29 {datetime('2003-10-22 12:24','+5 bogus')} NULL datetest 2.29 {datetime('2003-10-22 12:24','+5 bogus')} NULL
datetest 2.30 {datetime('2003-10-22 12:24','+++')} NULL
datetest 2.31 {datetime('2003-10-22 12:24','+12.3e4 femtoseconds')} NULL
datetest 2.32 {datetime('2003-10-22 12:24','+12.3e4 uS')} NULL
datetest 2.33 {datetime('2003-10-22 12:24','+1 abc')} NULL
datetest 2.34 {datetime('2003-10-22 12:24','+1 abcd')} NULL
datetest 2.35 {datetime('2003-10-22 12:24','+1 abcde')} NULL
datetest 2.36 {datetime('2003-10-22 12:24','+1 abcdef')} NULL
datetest 2.37 {datetime('2003-10-22 12:24','+1 abcdefg')} NULL
datetest 2.38 {datetime('2003-10-22 12:24','+1 abcdefgh')} NULL
datetest 2.39 {datetime('2003-10-22 12:24','+1 abcdefghi')} NULL
datetest 2.40 {datetime()} NULL
datetest 3.1 {strftime('%d','2003-10-31 12:34:56.432')} 31 datetest 3.1 {strftime('%d','2003-10-31 12:34:56.432')} 31
@ -165,6 +188,8 @@ datetest 5.2 {datetime('1994-04-16 14:00:00 -05:15')} {1994-04-16 19:15:00}
datetest 5.3 {datetime('1994-04-16 05:00:00 +08:30')} {1994-04-15 20:30:00} datetest 5.3 {datetime('1994-04-16 05:00:00 +08:30')} {1994-04-15 20:30:00}
datetest 5.4 {datetime('1994-04-16 14:00:00 -11:55')} {1994-04-17 01:55:00} datetest 5.4 {datetime('1994-04-16 14:00:00 -11:55')} {1994-04-17 01:55:00}
datetest 5.5 {datetime('1994-04-16 14:00:00 -11:60')} NULL datetest 5.5 {datetime('1994-04-16 14:00:00 -11:60')} NULL
datetest 5.4 {datetime('1994-04-16 14:00:00 -11:55 ')} {1994-04-17 01:55:00}
datetest 5.4 {datetime('1994-04-16 14:00:00 -11:55 x')} NULL
# localtime->utc and utc->localtime conversions. These tests only work # localtime->utc and utc->localtime conversions. These tests only work
# if the localtime is in the US Eastern Time (the time in Charlotte, NC # if the localtime is in the US Eastern Time (the time in Charlotte, NC
@ -204,6 +229,8 @@ if {$tzoffset==4} {
set sqlite_current_time \ set sqlite_current_time \
[db eval {SELECT strftime('%s','2000-07-01 12:34:56')}] [db eval {SELECT strftime('%s','2000-07-01 12:34:56')}]
datetest 6.16 {datetime('now','localtime')} {2000-07-01 08:34:56} datetest 6.16 {datetime('now','localtime')} {2000-07-01 08:34:56}
datetest 6.17 {datetime('now','localtimex')} NULL
datetest 6.18 {datetime('now','localtim')} NULL
set sqlite_current_time 0 set sqlite_current_time 0
} }
@ -250,6 +277,7 @@ datetest 8.16 {datetime('now','-5 years')} {1998-10-22 12:34:00}
datetest 8.17 {datetime('now','+10.5 minutes')} {2003-10-22 12:44:30} datetest 8.17 {datetime('now','+10.5 minutes')} {2003-10-22 12:44:30}
datetest 8.18 {datetime('now','-1.25 hours')} {2003-10-22 11:19:00} datetest 8.18 {datetime('now','-1.25 hours')} {2003-10-22 11:19:00}
datetest 8.19 {datetime('now','11.25 seconds')} {2003-10-22 12:34:11} datetest 8.19 {datetime('now','11.25 seconds')} {2003-10-22 12:34:11}
datetest 8.90 {datetime('now','abcdefghijklmnopqrstuvwyxzABCDEFGHIJLMNOP')} NULL
set sqlite_current_time 0 set sqlite_current_time 0
# Negative years work. Example: '-4713-11-26' is JD 1.5. # Negative years work. Example: '-4713-11-26' is JD 1.5.

View File

@ -11,7 +11,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 expressions. # focus of this file is testing expressions.
# #
# $Id: expr.test,v 1.52 2006/09/01 15:49:06 drh Exp $ # $Id: expr.test,v 1.53 2007/04/06 02:32:35 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -637,6 +637,9 @@ do_test expr-11.1 {
do_test expr-11.2 { do_test expr-11.2 {
execsql {SELECT typeof(9223372036854775808)} execsql {SELECT typeof(9223372036854775808)}
} {real} } {real}
do_test expr-11.3 {
execsql {SELECT typeof(92233720368547758070)}
} {real}
# These two statements used to leak memory (because of missing %destructor # These two statements used to leak memory (because of missing %destructor
# directives in parse.y). # directives in parse.y).