| 1 | puts "============" |
| 2 | puts "CR25436" |
| 3 | puts "Test case check work of the new commands vselnext and vselprev" |
| 4 | puts "============" |
| 5 | puts "" |
| 6 | |
| 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 | |
| 14 | if {$hiColor == "CYAN 1" && $nextColor == "YELLOW 1" && $nextNextColor == "YELLOW 1"} { |
| 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 | |
| 32 | box b 10 10 10 |
| 33 | vdisplay b |
| 34 | vfit |
| 35 | vselmode 2 1 |
| 36 | vmoveto 30 101 |
| 37 | |
| 38 | if { ![check_highlighting 0 $coords] } { |
| 39 | puts "ERROR: incorrect highlighting of edge 10" |
| 40 | } |
| 41 | |
| 42 | vselnext |
| 43 | if { ![check_highlighting 1 $coords] } { |
| 44 | puts "ERROR: incorrect highlighting of edge 2 after vselnext call" |
| 45 | } |
| 46 | vselnext |
| 47 | if { ![check_highlighting 2 $coords] } { |
| 48 | puts "ERROR: incorrect highlighting of edge 1 after vselnext call" |
| 49 | } |
| 50 | vselnext |
| 51 | if { ![check_highlighting 0 $coords] } { |
| 52 | puts "ERROR: incorrect highlighting of edge 10 after vselnext call" |
| 53 | } |
| 54 | |
| 55 | vselprev |
| 56 | if { ![check_highlighting 2 $coords] } { |
| 57 | puts "ERROR: incorrect highlighting of edge 1 after vselprev call" |
| 58 | } |
| 59 | vselprev |
| 60 | if { ![check_highlighting 1 $coords] } { |
| 61 | puts "ERROR: incorrect highlighting of edge 2 after vselprev call" |
| 62 | } |
| 63 | vselprev |
| 64 | if { ![check_highlighting 0 $coords] } { |
| 65 | puts "ERROR: incorrect highlighting of edge 10 after vselprev call" |
| 66 | } |