4ca4bbe8 |
1 | puts "============" |
2 | puts "CR25436" |
3 | puts "Test case check work of the new commands vselnext and vselprev" |
4 | puts "============" |
5 | puts "" |
6 | |
f0cddd16 |
7 | proc check_highlighting { theEdgeIdx theCoords } { |
8 | set aNext [expr ($theEdgeIdx + 1) % 3] |
9 | set aNextNext [expr ($theEdgeIdx + 2) % 3] |
10 | set hiColor [vreadpixel [lindex $theCoords [expr $theEdgeIdx * 2] ] [lindex $theCoords [expr $theEdgeIdx * 2 + 1] ] name] |
11 | set nextColor [vreadpixel [lindex $theCoords [expr $aNext * 2] ] [lindex $theCoords [expr $aNext * 2 + 1] ] name] |
12 | set nextNextColor [vreadpixel [lindex $theCoords [expr $aNextNext * 2] ] [lindex $theCoords [expr $aNextNext * 2 + 1] ] name] |
13 | |
aaf8d6a9 |
14 | if {$hiColor == "CYAN 1" && $nextColor == "YELLOW 1" && $nextNextColor == "YELLOW 1"} { |
f0cddd16 |
15 | return true |
16 | } else { |
17 | return false |
18 | } |
19 | } |
20 | |
21 | set coords { } |
22 | # e10_x, e10_y |
23 | lappend coords 94 |
24 | lappend coords 140 |
25 | # e2_x, e2_y |
26 | lappend coords 103 |
27 | lappend coords 60 |
28 | # e1_x, e1_y |
29 | lappend coords 29 |
30 | lappend coords 208 |
31 | |
4ca4bbe8 |
32 | box b 10 10 10 |
33 | vdisplay b |
34 | vfit |
35 | vselmode 2 1 |
36 | vmoveto 30 101 |
37 | |
f0cddd16 |
38 | if { ![check_highlighting 0 $coords] } { |
39 | puts "ERROR: incorrect highlighting of edge 10" |
40 | } |
41 | |
4ca4bbe8 |
42 | vselnext |
f0cddd16 |
43 | if { ![check_highlighting 1 $coords] } { |
44 | puts "ERROR: incorrect highlighting of edge 2 after vselnext call" |
45 | } |
4ca4bbe8 |
46 | vselnext |
f0cddd16 |
47 | if { ![check_highlighting 2 $coords] } { |
48 | puts "ERROR: incorrect highlighting of edge 1 after vselnext call" |
49 | } |
4ca4bbe8 |
50 | vselnext |
f0cddd16 |
51 | if { ![check_highlighting 0 $coords] } { |
52 | puts "ERROR: incorrect highlighting of edge 10 after vselnext call" |
53 | } |
4ca4bbe8 |
54 | |
55 | vselprev |
f0cddd16 |
56 | if { ![check_highlighting 2 $coords] } { |
57 | puts "ERROR: incorrect highlighting of edge 1 after vselprev call" |
58 | } |
4ca4bbe8 |
59 | vselprev |
f0cddd16 |
60 | if { ![check_highlighting 1 $coords] } { |
61 | puts "ERROR: incorrect highlighting of edge 2 after vselprev call" |
62 | } |
4ca4bbe8 |
63 | vselprev |
f0cddd16 |
64 | if { ![check_highlighting 0 $coords] } { |
65 | puts "ERROR: incorrect highlighting of edge 10 after vselprev call" |
66 | } |