From: drh Date: Fri, 1 Sep 2006 15:49:05 +0000 (+0000) Subject: Remove use of the "clock" command in the test suite so that the tests X-Git-Tag: version-3.6.10~2787 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9645d8d4b311fcd8995aecb7991cb20c8695b243;p=thirdparty%2Fsqlite.git 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 --- diff --git a/manifest b/manifest index 4fb1200e9a..45d2d835d4 100644 --- a/manifest +++ b/manifest @@ -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) -D 2006-09-01T00:33:44 +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-01T15:49:06 F Makefile.in 8e7f9ecebab2c6e0f3db20ff129a8f9405ab64f8 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -174,7 +174,7 @@ F test/corrupt.test 18c7a995b1af76a8c8600b996257f2c7b7bff083 F test/corrupt2.test 88342570828f2b8cbbd8369eff3891f5c0bdd5ba F test/crash.test 5f5f155393c5685b3842fef79b6fbafa55197d75 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2 -F test/date.test 288b41dbcc7aa114a976c53b45b78b3aa7736940 +F test/date.test fa6cc4e5fb79a207f77b66a51d2b3244ac76feae F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb F test/delete.test 525a6953bc3978780cae35f3eaf1027cf4ce887d F test/delete2.test c06be3806ba804bc8c6f134476816080280b40e3 @@ -187,7 +187,7 @@ F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52 F test/enc2.test 9f15cb7adc745fbb93d083ae1cf5a2deaa04d25f F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030 -F test/expr.test 7b4b349abdb05ab1862c1cfcf7607e3731efc5d2 +F test/expr.test c78843f730ccbe973d0c2ad1c99978f936893131 F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc F test/func.test 7f2c91a948a0a177635835dc9afa078413c54ae1 @@ -267,9 +267,9 @@ F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5 F test/subquery.test ae324ee928c5fb463a3ce08a8860d6e7f1ca5797 F test/subselect.test 2d13fb7f450db3595adcdd24079a0dd1d2d6abc2 F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3 -F test/table.test 1c1539af8db89c68e467df02ec2607ec61c67bac +F test/table.test feea6a3eb08cf166f570255eea5447e42ef82498 F test/tableapi.test a1982276274d292110d549206bc365b2da43e2ee -F test/tclsqlite.test e7f7b891ccd971379106a656d4b2f27d246cc8fd +F test/tclsqlite.test 51334389283c74bcbe28645a73159b17e239e9f3 F test/temptable.test c36f3e5a94507abb64f7ba23deeb4e1a8a8c3821 F test/tester.tcl 0436eda9b45cd937662b9766262cc2527448413f F test/thread1.test 776c9e459b75ba905193b351926ac4019b049f35 @@ -395,7 +395,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 2631ceaeefaca3aa837e3b439399f13c51456914 -R bf6613b7207109dfed32ae2e7006a594 -U shess -Z cf547d0db53b934ed26942ed5bd3801c +P 5844db1aa9c23a005c88104b084f68afb21891c7 +R 765da857e431aa5621e7d9277521435a +U drh +Z 7b02ae26a0272b8886b39369de36f0d1 diff --git a/manifest.uuid b/manifest.uuid index 38f835b8d7..0d74b23c8d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5844db1aa9c23a005c88104b084f68afb21891c7 \ No newline at end of file +bedbac54db173ceb74bd78acd021209f28aa30a8 \ No newline at end of file diff --git a/test/date.test b/test/date.test index 0e69315f51..516ea67d26 100644 --- a/test/date.test +++ b/test/date.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # 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] 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')" \ [repeat 200 abc10123] -set now [clock format [clock seconds] -format "%Y-%m-%d" -gmt 1] -datetest 4.1 {date('now')} $now +set sqlite_current_time 1157124367 +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.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 # 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')}\ {2000-10-29 01:59:00} datetest 6.2 {datetime('2000-10-29 06:00:00','localtime')}\ diff --git a/test/expr.test b/test/expr.test index 85b65d9a7c..7137a1ae65 100644 --- a/test/expr.test +++ b/test/expr.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # 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] 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. # -set sqlite_current_time [clock seconds] -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] +set sqlite_current_time 1157124849 do_test expr-8.1 { execsql {SELECT CURRENT_TIME} -} $time +} {15:34:09} do_test expr-8.2 { execsql {SELECT CURRENT_DATE} -} $date +} {2006-09-01} do_test expr-8.3 { execsql {SELECT CURRENT_TIMESTAMP} -} [list "$date $time"] +} {{2006-09-01 15:34:09}} ifcapable datetime { do_test expr-8.4 { execsql {SELECT CURRENT_TIME==time('now');} diff --git a/test/table.test b/test/table.test index 18cb806c77..e9c0ec2d4d 100644 --- a/test/table.test +++ b/test/table.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # 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] source $testdir/tester.tcl @@ -565,15 +565,14 @@ do_test table-13.1 { } } {} set i 0 -foreach {date time} { - 1976-07-04 12:00:00 - 1994-04-16 14:00:00 - 2000-01-01 00:00:00 - 2003-12-31 12:34:56 +foreach {date time seconds} { + 1976-07-04 12:00:00 205329600 + 1994-04-16 14:00:00 766504800 + 2000-01-01 00:00:00 946684800 + 2003-12-31 12:34:56 1072874096 } { incr i - set sqlite_current_time [clock scan "$date $time" -gmt 1] - # set sqlite_current_time [execsql "SELECT strftime('%s','$date $time')"] + set sqlite_current_time $seconds do_test table-13.2.$i { execsql " INSERT INTO tablet8(a) VALUES($i); diff --git a/test/tclsqlite.test b/test/tclsqlite.test index 0c3de04aa9..cc5ce412a9 100644 --- a/test/tclsqlite.test +++ b/test/tclsqlite.test @@ -15,7 +15,7 @@ # interface is pretty well tested. This file contains some addition # 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] source $testdir/tester.tcl @@ -325,11 +325,11 @@ do_test tcl-9.1 { execsql {SELECT typeof(ret_str())} } {text} 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())} } {real} 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())} } {integer}