Remove use of the "clock" command in the test suite so that the tests

will run in Tcl8.5.  Ticket #1445. (CVS 3380)

FossilOrigin-Name: bedbac54db173ceb74bd78acd021209f28aa30a8
This commit is contained in:
drh 2006-09-01 15:49:05 +00:00
parent b2f4d0173a
commit 9645d8d4b3
6 changed files with 36 additions and 33 deletions

View File

@ -1,5 +1,5 @@
C Make\sfts1.c\snot\srely\son\snul-terminated\sstrings.\s\sMostly\sa\smatter\sof\nmaking\ssure\swe\salways\spass\saround\sptr/len,\sbut\sthere\swere\sa\sfew\splaces\nwhere\swe\sactually\srelied\son\snul-termination.\n\nAn\searlier\schange\shad\sadditionally\schanged\sappropriate\nsqlite3_bind_text()\scalls\sto\ssqlite3_bind_blob().\s\sI've\sfound\sthat\nthis\schanges\swhat's\sactually\sstored\sin\sthe\sdatabase,\sso\sbacked\sthose\nchanges\sout.\s\sAlso\s(and\sthis\sis\sweird),\sI\sfound\sthat\sI\scould\sno\slonger\ndo\sstraight-forward\s=\squeries\sagainst\s%_term.term\sat\sa\scommand-line.\s(CVS\s3379) C Remove\suse\sof\sthe\s"clock"\scommand\sin\sthe\stest\ssuite\sso\sthat\sthe\stests\nwill\srun\sin\sTcl8.5.\s\sTicket\s#1445.\s(CVS\s3380)
D 2006-09-01T00:33:44 D 2006-09-01T15:49:06
F Makefile.in 8e7f9ecebab2c6e0f3db20ff129a8f9405ab64f8 F Makefile.in 8e7f9ecebab2c6e0f3db20ff129a8f9405ab64f8
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -174,7 +174,7 @@ F test/corrupt.test 18c7a995b1af76a8c8600b996257f2c7b7bff083
F test/corrupt2.test 88342570828f2b8cbbd8369eff3891f5c0bdd5ba F test/corrupt2.test 88342570828f2b8cbbd8369eff3891f5c0bdd5ba
F test/crash.test 5f5f155393c5685b3842fef79b6fbafa55197d75 F test/crash.test 5f5f155393c5685b3842fef79b6fbafa55197d75
F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
F test/date.test 288b41dbcc7aa114a976c53b45b78b3aa7736940 F test/date.test fa6cc4e5fb79a207f77b66a51d2b3244ac76feae
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
@ -187,7 +187,7 @@ F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b
F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52 F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52
F test/enc2.test 9f15cb7adc745fbb93d083ae1cf5a2deaa04d25f F test/enc2.test 9f15cb7adc745fbb93d083ae1cf5a2deaa04d25f
F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030 F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030
F test/expr.test 7b4b349abdb05ab1862c1cfcf7607e3731efc5d2 F test/expr.test c78843f730ccbe973d0c2ad1c99978f936893131
F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce
F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc
F test/func.test 7f2c91a948a0a177635835dc9afa078413c54ae1 F test/func.test 7f2c91a948a0a177635835dc9afa078413c54ae1
@ -267,9 +267,9 @@ F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5
F test/subquery.test ae324ee928c5fb463a3ce08a8860d6e7f1ca5797 F test/subquery.test ae324ee928c5fb463a3ce08a8860d6e7f1ca5797
F test/subselect.test 2d13fb7f450db3595adcdd24079a0dd1d2d6abc2 F test/subselect.test 2d13fb7f450db3595adcdd24079a0dd1d2d6abc2
F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3 F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3
F test/table.test 1c1539af8db89c68e467df02ec2607ec61c67bac F test/table.test feea6a3eb08cf166f570255eea5447e42ef82498
F test/tableapi.test a1982276274d292110d549206bc365b2da43e2ee F test/tableapi.test a1982276274d292110d549206bc365b2da43e2ee
F test/tclsqlite.test e7f7b891ccd971379106a656d4b2f27d246cc8fd F test/tclsqlite.test 51334389283c74bcbe28645a73159b17e239e9f3
F test/temptable.test c36f3e5a94507abb64f7ba23deeb4e1a8a8c3821 F test/temptable.test c36f3e5a94507abb64f7ba23deeb4e1a8a8c3821
F test/tester.tcl 0436eda9b45cd937662b9766262cc2527448413f F test/tester.tcl 0436eda9b45cd937662b9766262cc2527448413f
F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35 F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35
@ -395,7 +395,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 2631ceaeefaca3aa837e3b439399f13c51456914 P 5844db1aa9c23a005c88104b084f68afb21891c7
R bf6613b7207109dfed32ae2e7006a594 R 765da857e431aa5621e7d9277521435a
U shess U drh
Z cf547d0db53b934ed26942ed5bd3801c Z 7b02ae26a0272b8886b39369de36f0d1

View File

@ -1 +1 @@
5844db1aa9c23a005c88104b084f68afb21891c7 bedbac54db173ceb74bd78acd021209f28aa30a8

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.14 2006/01/09 00:18:03 drh Exp $ # $Id: date.test,v 1.15 2006/09/01 15:49:06 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -139,8 +139,9 @@ datetest 3.16 "strftime('[repeat 200 %Y]','2003-10-31')" [repeat 200 2003]
datetest 3.17 "strftime('[repeat 200 abc%m123]','2003-10-31')" \ datetest 3.17 "strftime('[repeat 200 abc%m123]','2003-10-31')" \
[repeat 200 abc10123] [repeat 200 abc10123]
set now [clock format [clock seconds] -format "%Y-%m-%d" -gmt 1] set sqlite_current_time 1157124367
datetest 4.1 {date('now')} $now datetest 4.1 {date('now')} {2006-09-01}
set sqlite_current_time 0
datetest 5.1 {datetime('1994-04-16 14:00:00 +05:00')} {1994-04-16 09:00:00} datetest 5.1 {datetime('1994-04-16 14:00:00 +05:00')} {1994-04-16 09:00:00}
datetest 5.2 {datetime('1994-04-16 14:00:00 -05:15')} {1994-04-16 19:15:00} datetest 5.2 {datetime('1994-04-16 14:00:00 -05:15')} {1994-04-16 19:15:00}
@ -152,7 +153,12 @@ datetest 5.5 {datetime('1994-04-16 14:00:00 -11:60')} NULL
# 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
# and in New York.) # and in New York.)
# #
if {[clock scan [clock format 0 -format {%b %d, %Y %H:%M:%S}] -gmt 1]==-18000} { set tzoffset [db one {
SELECT CAST(24*(julianday('2006-09-01') -
julianday('2006-09-01','localtime'))+0.5
AS INT)
}]
if {$tzoffset==4} {
datetest 6.1 {datetime('2000-10-29 05:59:00','localtime')}\ datetest 6.1 {datetime('2000-10-29 05:59:00','localtime')}\
{2000-10-29 01:59:00} {2000-10-29 01:59:00}
datetest 6.2 {datetime('2000-10-29 06:00:00','localtime')}\ datetest 6.2 {datetime('2000-10-29 06:00:00','localtime')}\

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.51 2006/03/03 19:12:30 drh Exp $ # $Id: expr.test,v 1.52 2006/09/01 15:49:06 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -593,18 +593,16 @@ test_expr2 expr-7.63 {GLOB('*1[456]',b)} {4}
# Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions. # Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions.
# #
set sqlite_current_time [clock seconds] set sqlite_current_time 1157124849
set date [clock format $sqlite_current_time -format %Y-%m-%d -gmt 1]
set time [clock format $sqlite_current_time -format %H:%M:%S -gmt 1]
do_test expr-8.1 { do_test expr-8.1 {
execsql {SELECT CURRENT_TIME} execsql {SELECT CURRENT_TIME}
} $time } {15:34:09}
do_test expr-8.2 { do_test expr-8.2 {
execsql {SELECT CURRENT_DATE} execsql {SELECT CURRENT_DATE}
} $date } {2006-09-01}
do_test expr-8.3 { do_test expr-8.3 {
execsql {SELECT CURRENT_TIMESTAMP} execsql {SELECT CURRENT_TIMESTAMP}
} [list "$date $time"] } {{2006-09-01 15:34:09}}
ifcapable datetime { ifcapable datetime {
do_test expr-8.4 { do_test expr-8.4 {
execsql {SELECT CURRENT_TIME==time('now');} execsql {SELECT CURRENT_TIME==time('now');}

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 the CREATE TABLE statement. # focus of this file is testing the CREATE TABLE statement.
# #
# $Id: table.test,v 1.45 2006/03/29 00:24:07 drh Exp $ # $Id: table.test,v 1.46 2006/09/01 15:49:06 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -565,15 +565,14 @@ do_test table-13.1 {
} }
} {} } {}
set i 0 set i 0
foreach {date time} { foreach {date time seconds} {
1976-07-04 12:00:00 1976-07-04 12:00:00 205329600
1994-04-16 14:00:00 1994-04-16 14:00:00 766504800
2000-01-01 00:00:00 2000-01-01 00:00:00 946684800
2003-12-31 12:34:56 2003-12-31 12:34:56 1072874096
} { } {
incr i incr i
set sqlite_current_time [clock scan "$date $time" -gmt 1] set sqlite_current_time $seconds
# set sqlite_current_time [execsql "SELECT strftime('%s','$date $time')"]
do_test table-13.2.$i { do_test table-13.2.$i {
execsql " execsql "
INSERT INTO tablet8(a) VALUES($i); INSERT INTO tablet8(a) VALUES($i);

View File

@ -15,7 +15,7 @@
# interface is pretty well tested. This file contains some addition # interface is pretty well tested. This file contains some addition
# tests for fringe issues that the main test suite does not cover. # tests for fringe issues that the main test suite does not cover.
# #
# $Id: tclsqlite.test,v 1.55 2006/07/17 00:02:46 drh Exp $ # $Id: tclsqlite.test,v 1.56 2006/09/01 15:49:06 drh Exp $
set testdir [file dirname $argv0] set testdir [file dirname $argv0]
source $testdir/tester.tcl source $testdir/tester.tcl
@ -325,11 +325,11 @@ do_test tcl-9.1 {
execsql {SELECT typeof(ret_str())} execsql {SELECT typeof(ret_str())}
} {text} } {text}
do_test tcl-9.2 { do_test tcl-9.2 {
db function ret_dbl {return [expr {[clock seconds]*0.5}]} db function ret_dbl {return [expr {rand()*0.5}]}
execsql {SELECT typeof(ret_dbl())} execsql {SELECT typeof(ret_dbl())}
} {real} } {real}
do_test tcl-9.3 { do_test tcl-9.3 {
db function ret_int {clock seconds} db function ret_int {return [expr {int(rand()*200)}]}
execsql {SELECT typeof(ret_int())} execsql {SELECT typeof(ret_int())}
} {integer} } {integer}