Skip to content

Commit 2f3adf9

Browse files
author
jan.nijtmans
committed
Add (back) failsOnXQuarz constraint for testcases (still) failing on XQuartz
1 parent 99762a8 commit 2f3adf9

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

tests/canvText.test

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace import ::tcltest::*
1111
eval tcltest::configure $argv
1212
tcltest::loadTestedCommands
1313

14+
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
15+
1416
# Canvas used in 1.* - 17.* tests
1517
canvas .c -width 400 -height 300 -bd 2 -relief sunken
1618
pack .c
@@ -260,7 +262,7 @@ test canvText-5.1 {ConfigureText procedure: adjust cursor} -body {
260262
} -result {}
261263

262264

263-
test canvText-6.1 {ComputeTextBbox procedure} -constraints fonts -setup {
265+
test canvText-6.1 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup {
264266
.c delete test
265267
} -body {
266268
set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
@@ -312,7 +314,7 @@ test canvText-6.4 {ComputeTextBbox procedure} -constraints fonts -setup {
312314
} -cleanup {
313315
.c delete test
314316
} -result 1
315-
test canvText-6.5 {ComputeTextBbox procedure} -constraints fonts -setup {
317+
test canvText-6.5 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup {
316318
.c delete test
317319
} -body {
318320
set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
@@ -364,7 +366,7 @@ test canvText-6.8 {ComputeTextBbox procedure} -constraints fonts -setup {
364366
} -cleanup {
365367
.c delete test
366368
} -result 1
367-
test canvText-6.9 {ComputeTextBbox procedure} -constraints fonts -setup {
369+
test canvText-6.9 {ComputeTextBbox procedure} -constraints {fonts failsOnXQuarz} -setup {
368370
.c delete test
369371
} -body {
370372
set font "-adobe-times-medium-r-normal--*-200-*-*-*-*-*-*"
@@ -906,20 +908,20 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup
906908
set s1 { Yeah-ah-ah-ah-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-oh-Yow}
907909
set s2 { Yeah ah ah ah oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh oh Yow}
908910
$c create text 21 18 \
909-
-font $f \
910-
-text $s1 \
911-
-fill white \
912-
-width 922 \
913-
-anchor nw \
914-
-tags tbox1
911+
-font $f \
912+
-text $s1 \
913+
-fill white \
914+
-width 922 \
915+
-anchor nw \
916+
-tags tbox1
915917
$c create rect {*}[$c bbox tbox1] -outline red
916918
$c create text 21 160 \
917-
-font $f \
918-
-text $s2 \
919-
-fill white \
920-
-width 922 \
921-
-anchor nw \
922-
-tags tbox2
919+
-font $f \
920+
-text $s2 \
921+
-fill white \
922+
-width 922 \
923+
-anchor nw \
924+
-tags tbox2
923925
$c create rect {*}[$c bbox tbox2] -outline red
924926
after 500 "set done 1" ; vwait done
925927
set results [list]
@@ -931,7 +933,7 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup
931933
lappend results [selection get]
932934
array set metrics [font metrics $f]
933935
set x [expr {21 + [font measure $f " "] \
934-
+ ([font measure {Arial 28 bold} "Y"] / 2)}]
936+
+ ([font measure {Arial 28 bold} "Y"] / 2)}]
935937
set y1 [expr {18 + ($metrics(-linespace) / 2)}]
936938
set y2 [expr {160 + ($metrics(-linespace) / 2)}]
937939
lappend results [$c index tbox1 @$x,$y1]
@@ -948,10 +950,10 @@ test canvText-20.1 {angled text bounding box} -setup {
948950
list $b $a $d $c
949951
}
950952
proc almosteq {b1 b2} {
951-
# check whether the two boxes are equal, with 1 unit tolerance on each x y w h
952-
lassign $b1 a b c d
953-
lassign $b2 e f g h
954-
expr {($e-$a)<=1 && ($f-$b)<=1 && ($g-$c)<=1 && ($h-$d)<=1}
953+
# check whether the two boxes are equal, with 1 unit tolerance on each x y w h
954+
lassign $b1 a b c d
955+
lassign $b2 e f g h
956+
expr {($e-$a)<=1 && ($f-$b)<=1 && ($g-$c)<=1 && ($h-$d)<=1}
955957
}
956958
} -body {
957959
.c create text 2 2 -tag t -anchor center -text 0 -font {TkDefaultFont 24}

0 commit comments

Comments
 (0)