summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:00:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-03-18 21:00:37 (GMT)
commit2f563d12979d7011cdde4eccacb98e0b3703cb5b (patch)
tree499d1a2a8df4ce910f623e843e0790cc93fe35f1 /tests
parent995953339ac39e45eb6f5fa4dce37a6f0d5e3bf6 (diff)
parent3dcd8fde2d4e9a6bc85ac198433cc06952332c5f (diff)
downloadtk-2f563d12979d7011cdde4eccacb98e0b3703cb5b.zip
tk-2f563d12979d7011cdde4eccacb98e0b3703cb5b.tar.gz
tk-2f563d12979d7011cdde4eccacb98e0b3703cb5b.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 27ec152..8557252 100644
--- a/tests/color.test
+++ b/tests/color.test
@@ -75,8 +75,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 --
@@ -154,6 +154,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]