summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:02:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:02:14 (GMT)
commite82ec654c94d1f0ae357d10c1e9ab6df5830b720 (patch)
treebd01c418e74f36228aab66e22562cf9e69a7383e /tests
parent067a4ef692203b73a81ed296879fc8e28361f0ac (diff)
parent2f563d12979d7011cdde4eccacb98e0b3703cb5b (diff)
downloadtk-e82ec654c94d1f0ae357d10c1e9ab6df5830b720.zip
tk-e82ec654c94d1f0ae357d10c1e9ab6df5830b720.tar.gz
tk-e82ec654c94d1f0ae357d10c1e9ab6df5830b720.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]