1 if { [isdraw result] } {
2 #check if result is valid
5 set ch [checkshape result]
8 if {[info exists command] && ${command} == "mkvolume"} {
9 set bcheck [bopcheck result]
11 if {![regexp {This shape seems to be OK.} $bcheck]} {
12 puts "Error: bopcheck failed"
15 if { [info exists square] } {
18 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
20 if { [info exists length] } {
23 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
26 puts [checksection result]
29 #if mass (length or square) is empty in test case then result should be an empty shape.
30 if { [info exists mass] && [string compare "$mass" "empty"] != 0 } {
32 puts "Error : The $command is not valid. The $prop is 0."
35 puts "The expected $prop is $mass"
37 #check of change of square is < 1%
38 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
39 puts "Error : The $prop of the resulting shape is $m"
42 if { [info exists nbsh_v ] } {
43 set arr_v [explode result v]
44 set nb_v [ llength $arr_v ]
45 if { $nb_v != $nbsh_v } {
46 puts "Error : The resulting shape is WRONG because it must contain $nbsh_v vertexes instead of $nb_v"
48 puts "The resulting shape contains $nb_v vertexes"
53 if { [info exists nbsh_e ] } {
54 set arr_e [explode result e]
55 set nb_e [ llength $arr_e ]
56 if { $nb_e != $nbsh_e } {
57 puts "Error : The resulting shape is WRONG because it must contain $nbsh_e edges instead of $nb_e"
59 puts "The resulting shape contains $nb_e edges"
63 if { [info exists mass] && $m != 0 } {
64 puts "Error : The $command is not valid. The $prop is $m"
69 if { [info exists m ] } {
72 if { [info exists nbsh_v ] } {
82 xwd $imagedir/${test_image}.png
84 puts "Error : The $command cannot be built."
87 # to end a test script