summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:03:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:03:37 (GMT)
commit124fa60cc29955a740d347b52343d826fdf9216d (patch)
treea58d74021de2129e7400c0d3d89c82f9dcbe6adf /tests
parentf83e6394a1cbc1886fc8dc164d8c461bbc8f46d1 (diff)
parente82ec654c94d1f0ae357d10c1e9ab6df5830b720 (diff)
downloadtk-124fa60cc29955a740d347b52343d826fdf9216d.zip
tk-124fa60cc29955a740d347b52343d826fdf9216d.tar.gz
tk-124fa60cc29955a740d347b52343d826fdf9216d.tar.bz2
rfe-3503317: XParseColor speedup
Diffstat (limited to 'tests')
-rw-r--r--tests/color.test17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/color.test b/tests/color.test
index 6b31df7..a7ed1f8 100644
--- a/tests/color.test
+++ b/tests/color.test
@@ -70,8 +70,8 @@ proc closest {w r g b} {
# vals - List of intensities.
proc c255 {vals} {
- list [expr [lindex $vals 0]/256] [expr [lindex $vals 1]/256] \
- [expr [lindex $vals 2]/256]
+ list [expr {[lindex $vals 0]/256}] [expr {[lindex $vals 1]/256}] \
+ [expr {[lindex $vals 2]/256}]
}
# colorsFree --
@@ -149,6 +149,19 @@ test color-1.4 {Tk_AllocColorFromObj - try other colors in list} colorsFree {
pack .b2 -side top
lappend result [testcolor purple]
} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
+test color-1.5 {Color table} nonPortable {
+ set fd [open ../xlib/rgb.txt]
+ set result {}
+ while {[gets $fd line] != -1} {
+ if {[string index $line 0] == "!"} continue
+ set rgb [c255 [winfo rgb . [lrange $line 3 end]]]
+ if {$rgb != [lrange $line 0 2] } {
+ append result $line\n
+ }
+
+ }
+ return $result
+} {}
test color-2.1 {Tk_GetColor procedure} colorsFree {
c255 [winfo rgb .t #FF0000]