/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to test/enc4.test.

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

        do_test enc4-$i.$j.$k.3.$x {
          sqlite3_reset $S
          sqlite3_bind_text $S 1 $val $x
          sqlite3_step $S
          sqlite3_column_text $S 0
        } [list $part]
        
        do_test enc4-$i.$j.$k.4.$x {
          sqlite3_reset $S
          sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2]
          sqlite3_step $S
          sqlite3_column_text $S 0
        } [list $part]
      }
      







|
|
<
<
|
|






|







57
58
59
60
61
62
63
64
65


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
    do_test enc4-$i.$j.2 {
      set S [sqlite3_prepare_v2 db "SELECT $init+?" -1 dummy]
      sqlite3_expired $S
    } {0}
      
    set k 1
    foreach val $vals {
      for {set x 1} {$x<16} {incr x} {
        set part [expr $init + [string range $val 0 [expr $x-1]]]



        do_realnum_test enc4-$i.$j.$k.3.$x {
          sqlite3_reset $S
          sqlite3_bind_text $S 1 $val $x
          sqlite3_step $S
          sqlite3_column_text $S 0
        } [list $part]
        
        do_realnum_test enc4-$i.$j.$k.4.$x {
          sqlite3_reset $S
          sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2]
          sqlite3_step $S
          sqlite3_column_text $S 0
        } [list $part]
      }
      

Changes to test/tester.tcl.

351
352
353
354
355
356
357

358
359
360
361
362
363
364
365
  } else {
    puts " Ok"
  }
  flush stdout
}

proc realnum_normalize {r} {

  string map {1.#INF inf} [regsub -all {(e[+-])0+} $r {\1}]
}
proc do_realnum_test {name cmd expected} {
  uplevel [list do_test $name [
    subst -nocommands { realnum_normalize [ $cmd ] }
  ] [realnum_normalize $expected]]
}








>
|







351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
  } else {
    puts " Ok"
  }
  flush stdout
}

proc realnum_normalize {r} {
  # different TCL versions display floating point values differently.
  string map {1.#INF inf Inf inf .0e e} [regsub -all {(e[+-])0+} $r {\1}]
}
proc do_realnum_test {name cmd expected} {
  uplevel [list do_test $name [
    subst -nocommands { realnum_normalize [ $cmd ] }
  ] [realnum_normalize $expected]]
}