diff options
Diffstat (limited to 'tests/scrollbar.test')
-rw-r--r-- | tests/scrollbar.test | 94 |
1 files changed, 45 insertions, 49 deletions
diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 9773b54..b85c020 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: scrollbar.test,v 1.13 2004/06/17 22:38:57 dkf Exp $ +# RCS: @(#) $Id: scrollbar.test,v 1.14 2004/06/24 12:45:43 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -161,16 +161,16 @@ test scrollbar-3.10 {ScrollbarWidgetCmd procedure, "cget" option} { list [catch {.s cget -orient} msg] $msg } {0 vertical} scrollbar .s2 -test scrollbar-3.11 {ScrollbarWidgetCmd procedure, "cget" option} {pcOnly} { +test scrollbar-3.11 {ScrollbarWidgetCmd procedure, "cget" option} win { list [catch {.s2 cget -bd} msg] $msg } {0 0} -test scrollbar-3.12 {ScrollbarWidgetCmd procedure, "cget" option} {unixOnly} { +test scrollbar-3.12 {ScrollbarWidgetCmd procedure, "cget" option} unix { list [catch {.s2 cget -bd} msg] $msg } {0 2} -test scrollbar-3.13 {ScrollbarWidgetCmd procedure, "cget" option} {pcOnly} { +test scrollbar-3.13 {ScrollbarWidgetCmd procedure, "cget" option} win { list [catch {.s2 cget -highlightthickness} msg] $msg } {0 0} -test scrollbar-3.14 {ScrollbarWidgetCmd procedure, "cget" option} {unixOnly} { +test scrollbar-3.14 {ScrollbarWidgetCmd procedure, "cget" option} unix { list [catch {.s2 cget -highlightthickness} msg] $msg } {0 1} destroy .s2 @@ -249,16 +249,16 @@ test scrollbar-3.35 {ScrollbarWidgetCmd procedure, "fraction" option} { .s fraction 4 21 } [format %.6g [expr (21.0 - ([winfo height .s] - [getTroughSize .s])/2.0) \ /([getTroughSize .s] - 1)]] -test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} {unixOnly} { +test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} unix { .s fraction 4 179 } {1} test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics} { .s fraction 4 [expr 200 - [testmetrics cyvscroll .s]] } {1} -test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} {unixOnly} { +test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} unix { .s fraction 4 178 } {0.993711} -test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics pcOnly} { +test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics win} { expr [.s fraction 4 [expr 200 - [testmetrics cyvscroll .s] - 2]] \ == [format %g [expr (200.0 - [testmetrics cyvscroll .s]*2 - 2) \ / ($height - 1 - [testmetrics cyvscroll .s]*2)]] @@ -326,7 +326,7 @@ test scrollbar-3.53 {ScrollbarWidgetCmd procedure, "identify" option} { test scrollbar-3.54 {ScrollbarWidgetCmd procedure, "identify" option} {unixOrPc} { .s identify 5 195 } {arrow2} -test scrollbar-3.56 {ScrollbarWidgetCmd procedure, "identify" option} {unixOnly} { +test scrollbar-3.56 {ScrollbarWidgetCmd procedure, "identify" option} unix { .s identify 0 0 } {} test scrollbar-3.57 {ScrollbarWidgetCmd procedure, "set" option} { @@ -423,16 +423,17 @@ scrollbar .s -orient vertical -relief sunken -bd 2 -highlightthickness 2 pack .s -side left -fill y .s set .2 .4 update -test scrollbar-6.1 {ScrollbarPosition procedure} {unixOnly} { + +test scrollbar-6.1 {ScrollbarPosition procedure} unix { .s identify 8 3 } {} -test scrollbar-6.3 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.3 {ScrollbarPosition procedure} unix { .s identify 8 196 } {} -test scrollbar-6.4 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.4 {ScrollbarPosition procedure} unix { .s identify 3 100 } {} -test scrollbar-6.6 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.6 {ScrollbarPosition procedure} unix { .s identify 19 100 } {} test scrollbar-6.7 {ScrollbarPosition procedure} { @@ -447,60 +448,56 @@ test scrollbar-6.9 {ScrollbarPosition procedure} { test scrollbar-6.10 {ScrollbarPosition procedure} { .s identify [winfo width .s] [expr [winfo height .s] / 2] } {} - -test scrollbar-6.11 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.11 {ScrollbarPosition procedure} unix { .s identify 8 4 } {arrow1} -test scrollbar-6.12 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.12 {ScrollbarPosition procedure} unix { .s identify 8 19 } {arrow1} -test scrollbar-6.14 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.14 {ScrollbarPosition procedure} win { .s identify [expr [winfo width .s] / 2] 0 } {arrow1} -test scrollbar-6.15 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.15 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr [testmetrics cyvscroll] - 1] } {arrow1} - -test scrollbar-6.16 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.16 {ScrollbarPosition procedure} unix { .s identify 8 20 } {trough1} -test scrollbar-6.17 {ScrollbarPosition procedure} {unixOnly nonPortable} { +test scrollbar-6.17 {ScrollbarPosition procedure} {unix nonPortable} { # Don't know why this is non-portable, but it doesn't work on # some platforms. .s identify 8 51 } {trough1} -test scrollbar-6.18 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.18 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [testmetrics cyvscroll] } {trough1} -test scrollbar-6.19 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.19 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr int(.2 / [.s delta 0 1]) \ + [testmetrics cyvscroll] - 1] } {trough1} - -test scrollbar-6.20 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.20 {ScrollbarPosition procedure} unix { .s identify 8 52 } {slider} -test scrollbar-6.21 {ScrollbarPosition procedure} {unixOnly nonPortable} { +test scrollbar-6.21 {ScrollbarPosition procedure} {unix nonPortable} { # Don't know why this is non-portable, but it doesn't work on # some platforms. .s identify 8 83 } {slider} -test scrollbar-6.22 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.22 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr int(.2 / [.s delta 0 1]) \ + [testmetrics cyvscroll]] } {slider} -test scrollbar-6.23 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.23 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr int(.4 / [.s delta 0 1]) \ + [testmetrics cyvscroll] - 1] } {slider} - -test scrollbar-6.24 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.24 {ScrollbarPosition procedure} unix { .s identify 8 84 } {trough2} -test scrollbar-6.25 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.25 {ScrollbarPosition procedure} unix { .s identify 8 179 } {trough2} -test scrollbar-6.27 {ScrollbarPosition procedure} {testmetrics pcOnly knownBug} { +test scrollbar-6.27 {ScrollbarPosition procedure} {testmetrics win knownBug} { # This asks for 8,21, which is actually the slider, but there is a # bug in that GetSystemMetrics(SM_CYVTHUMB) actually returns a value # that is larger than the thumb displayed, skewing the ability to @@ -508,35 +505,33 @@ test scrollbar-6.27 {ScrollbarPosition procedure} {testmetrics pcOnly knownBug} .s identify [expr [winfo width .s] / 2] [expr int(.4 / [.s delta 0 1]) \ + [testmetrics cyvscroll]] } {trough2} -test scrollbar-6.28 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.28 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr [winfo height .s] \ - [testmetrics cyvscroll] - 1] } {trough2} - -test scrollbar-6.29 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.29 {ScrollbarPosition procedure} unix { .s identify 8 180 } {arrow2} -test scrollbar-6.30 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.30 {ScrollbarPosition procedure} unix { .s identify 8 195 } {arrow2} -test scrollbar-6.32 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.32 {ScrollbarPosition procedure} {testmetrics win} { .s identify [expr [winfo width .s] / 2] [expr [winfo height .s] \ - [testmetrics cyvscroll]] } {arrow2} -test scrollbar-6.33 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.33 {ScrollbarPosition procedure} win { .s identify [expr [winfo width .s] / 2] [expr [winfo height .s] - 1] } {arrow2} - -test scrollbar-6.34 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.34 {ScrollbarPosition procedure} unix { .s identify 4 100 } {trough2} -test scrollbar-6.35 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.35 {ScrollbarPosition procedure} unix { .s identify 18 100 } {trough2} -test scrollbar-6.37 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.37 {ScrollbarPosition procedure} win { .s identify 0 100 } {trough2} -test scrollbar-6.38 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.38 {ScrollbarPosition procedure} win { .s identify [expr [winfo width .s] - 1] 100 } {trough2} @@ -547,23 +542,24 @@ scrollbar .t.s -orient horizontal -relief sunken -bd 2 -highlightthickness 2 place .t.s -width 200 .t.s set .2 .4 update -test scrollbar-6.39 {ScrollbarPosition procedure} {unixOnly} { + +test scrollbar-6.39 {ScrollbarPosition procedure} unix { .t.s identify 4 8 } {arrow1} -test scrollbar-6.40 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.40 {ScrollbarPosition procedure} win { .t.s identify 0 [expr [winfo height .t.s] / 2] } {arrow1} -test scrollbar-6.41 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.41 {ScrollbarPosition procedure} unix { .t.s identify 82 8 } {slider} -test scrollbar-6.43 {ScrollbarPosition procedure} {testmetrics pcOnly} { +test scrollbar-6.43 {ScrollbarPosition procedure} {testmetrics win} { .t.s identify [expr int(.4 / [.t.s delta 1 0]) + [testmetrics cxhscroll] \ - 1] [expr [winfo height .t.s] / 2] } {slider} -test scrollbar-6.44 {ScrollbarPosition procedure} {unixOnly} { +test scrollbar-6.44 {ScrollbarPosition procedure} unix { .t.s identify 100 18 } {trough2} -test scrollbar-6.46 {ScrollbarPosition procedure} {pcOnly} { +test scrollbar-6.46 {ScrollbarPosition procedure} win { .t.s identify 100 [expr [winfo height .t.s] - 1] } {trough2} |