1 if { [isdraw result] } {
2 #check if result is valid
5 set ch [checkshape result]
8 if { [info exists square] } {
11 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
13 if { [info exists length] } {
16 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
19 puts [checksection result]
22 #if mass (length or square) is empty in test case then result should be an empty shape.
23 if { [string compare "$mass" "empty"] != 0 } {
25 puts "Error : The $command is not valid. The $prop is 0."
28 puts "The expected $prop is $mass"
30 #check of change of square is < 1%
31 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
32 puts "Error : The $prop of the resulting shape is $m"
35 if { [info exists nbsh_v ] } {
36 set arr_v [explode result v]
37 set nb_v [ llength $arr_v ]
38 if { $nb_v != $nbsh_v } {
39 puts "Error : The resulting shape is WRONG because it must contain $nbsh_v vertexes instead of $nb_v"
41 puts "The resulting shape contains $nb_v vertexes"
46 if { [info exists nbsh_e ] } {
47 set arr_e [explode result e]
48 set nb_e [ llength $arr_e ]
49 if { $nb_e != $nbsh_e } {
50 puts "Error : The resulting shape is WRONG because it must contain $nbsh_e edges instead of $nb_e"
52 puts "The resulting shape contains $nb_e edges"
57 puts "Error : The $command is not valid. The $prop is $m"
64 if { [info exists nbsh_v ] } {
71 xwd $imagedir/${test_image}.png
73 puts "Error : The $command cannot be built."
76 # to end a test script