/ Check-in [a4a8402b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a4a8402bfec381dd23b7a96c2f4b52c0dd728a7a
User & Date: shaneh 2011-06-20 17:41:41
Original Comment: Update a couple test scripts to account for more floating point variation under various Windows-based versions of TCL. Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL.
Context
2011-06-20
18:00
Rework the autoconf script to better deal with utime() and dlopen(). check-in: f69ed286 user: drh tags: trunk
17:41
Update a couple test scripts to account for more floating point display variation in Windows-based versions of TCL. check-in: a4a8402b user: shaneh tags: trunk
17:24
Fix various harmless compiler warnings in FTS3 and RTREE. check-in: fe62179e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/enc4.test.

    57     57       do_test enc4-$i.$j.2 {
    58     58         set S [sqlite3_prepare_v2 db "SELECT $init+?" -1 dummy]
    59     59         sqlite3_expired $S
    60     60       } {0}
    61     61         
    62     62       set k 1
    63     63       foreach val $vals {
    64         -      for {set x 1} {$x<18} {incr x} {
           64  +      for {set x 1} {$x<16} {incr x} {
    65     65           set part [expr $init + [string range $val 0 [expr $x-1]]]
    66         -        regsub {e\+0} $part {e+} part
    67         -        regsub {^1e} $part {1.0e} part
    68     66   
    69         -        do_test enc4-$i.$j.$k.3.$x {
           67  +        do_realnum_test enc4-$i.$j.$k.3.$x {
    70     68             sqlite3_reset $S
    71     69             sqlite3_bind_text $S 1 $val $x
    72     70             sqlite3_step $S
    73     71             sqlite3_column_text $S 0
    74     72           } [list $part]
    75     73           
    76         -        do_test enc4-$i.$j.$k.4.$x {
           74  +        do_realnum_test enc4-$i.$j.$k.4.$x {
    77     75             sqlite3_reset $S
    78     76             sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2]
    79     77             sqlite3_step $S
    80     78             sqlite3_column_text $S 0
    81     79           } [list $part]
    82     80         }
    83     81         

Changes to test/tester.tcl.

   351    351     } else {
   352    352       puts " Ok"
   353    353     }
   354    354     flush stdout
   355    355   }
   356    356   
   357    357   proc realnum_normalize {r} {
   358         -  string map {1.#INF inf} [regsub -all {(e[+-])0+} $r {\1}]
          358  +  # different TCL versions display floating point values differently.
          359  +  string map {1.#INF inf Inf inf .0e e} [regsub -all {(e[+-])0+} $r {\1}]
   359    360   }
   360    361   proc do_realnum_test {name cmd expected} {
   361    362     uplevel [list do_test $name [
   362    363       subst -nocommands { realnum_normalize [ $cmd ] }
   363    364     ] [realnum_normalize $expected]]
   364    365   }
   365    366