Tcl Source Code

Check-in [c925d4759d]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:closes [1a3fa1232e306a44], test case cmdMZ-6.5 fixed to cover float value by iteration per second
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA3-256: c925d4759d96961f5624ba5a2c5cebaf0fe91a5140fe9177cae69097ec4d6a09
User & Date: sebres 2019-04-01 13:53:54
References
2019-04-01
13:55 Closed ticket [1a3fa1232e]: test cmdMZ-6.5 not testing all code paths plus 6 other changes artifact: b6d3f2533b user: sebres
Context
2019-04-08
19:31
Add test-cases for win32/win64 --disable-shared, and put standard --enable-threads check-in: 2398513042 user: jan.nijtmans tags: core-8-5-branch
2019-04-01
14:00
merge 8.5 check-in: 11c73f263c user: sebres tags: core-8-6-branch
13:53
closes [1a3fa1232e306a44], test case cmdMZ-6.5 fixed to cover float value by iteration per second check-in: c925d4759d user: sebres tags: core-8-5-branch
13:51
timerate: avoid divide by zero by no iterations in measurement cycle (e. g. count is 0) check-in: c9ac395fd2 user: sebres tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/cmdMZ.test.

361
362
363
364
365
366
367
368



369
370
371
372
373
374
375
376
} {1 {expected integer but got "b"}}
test cmdMZ-6.3 {Tcl_TimeRateObjCmd: basic format of command} {
    list [catch {timerate -overhead b {} a b} msg] $msg
} {1 {expected floating-point number but got "b"}}
test cmdMZ-6.4 {Tcl_TimeRateObjCmd: compile of script happens even with negative iteration counts} {
    list [catch {timerate "foreach a {c d e} \{" -12456} msg] $msg
} {1 {missing close-brace}}
test cmdMZ-6.5 {Tcl_TimeRateObjCmd: result format and one iteration} {



    regexp {^\d+.\d+ \ws/# 1 # \d+ #/sec \d+.\d+ nett-ms$} [timerate {} 0]
} 1
test cmdMZ-6.6 {Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument} {
    set m1 [timerate {after 0} 20]
    set m2 [timerate {after 1} 20]
    list \
	[expr {[lindex $m1 0] < [lindex $m2 0]}] \
	[expr {[lindex $m1 0] < 100}] \






|
>
>
>
|







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
} {1 {expected integer but got "b"}}
test cmdMZ-6.3 {Tcl_TimeRateObjCmd: basic format of command} {
    list [catch {timerate -overhead b {} a b} msg] $msg
} {1 {expected floating-point number but got "b"}}
test cmdMZ-6.4 {Tcl_TimeRateObjCmd: compile of script happens even with negative iteration counts} {
    list [catch {timerate "foreach a {c d e} \{" -12456} msg] $msg
} {1 {missing close-brace}}
test cmdMZ-6.5a {Tcl_TimeRateObjCmd: result format and one iteration} {
    regexp {^\d+(?:\.\d+)? \ws/# 1 # \d+(?:\.\d+)? #/sec \d+(?:\.\d+)? nett-ms$} [timerate {} 0]
} 1
test cmdMZ-6.5b {Tcl_TimeRateObjCmd: result format without iterations} {
    regexp {^0 \ws/# 0 # 0 #/sec 0 nett-ms$} [timerate {} 0 0]
} 1
test cmdMZ-6.6 {Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument} {
    set m1 [timerate {after 0} 20]
    set m2 [timerate {after 1} 20]
    list \
	[expr {[lindex $m1 0] < [lindex $m2 0]}] \
	[expr {[lindex $m1 0] < 100}] \