2 if { [isdraw result] } {
3 #check if result is valid
5 puts [checkshape result]
8 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
10 if { [string compare "$mass" "empty"] != 0 } {
12 puts "Error : The $command is not valid. The $prop is 0."
15 puts "The expected $prop is $mass"
17 #check of change of square is < 1%
18 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
19 puts "Error : The $prop of the resulting shape is $m"
23 puts "Error : The $command is not valid. The $prop is $m"
27 set glob_inf [info global nb_*_good]
28 if { [regexp "nb_.*_good" $glob_inf] == 1 } {
29 if { [info exists nbsh_t] } {
30 set nb_info [nbshapes result -t]
32 set nb_info [nbshapes result]
36 if { [info exists nb_v_good] } {
37 regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
38 if { ${nb_v} != ${nb_v_good} } {
39 puts "Error : The resulting shape is WRONG because it must contains ${nb_v_good} vertexes instead of ${nb_v}"
41 puts "The resulting shape contains ${nb_v} vertexes"
45 if { [info exists nb_e_good] } {
46 regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e
47 if { ${nb_e} != ${nb_e_good} } {
48 puts "Error : The resulting shape is WRONG because it must contains ${nb_e_good} edges instead of ${nb_e}"
50 puts "The resulting shape contains ${nb_e} edges"
54 if { [info exists nb_w_good] } {
55 regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w
56 if { ${nb_w} != ${nb_w_good} } {
57 puts "Error : The resulting shape is WRONG because it must contains ${nb_w_good} wires instead of ${nb_w}"
59 puts "The resulting shape contains ${nb_w} wires"
63 if { [info exists nb_f_good] } {
64 regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f
65 if { ${nb_f} != ${nb_f_good} } {
66 puts "Error : The resulting shape is WRONG because it must contains ${nb_f_good} faces instead of ${nb_f}"
68 puts "The resulting shape contains ${nb_f} faces"
72 if { [info exists nb_sh_good] } {
73 regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh
74 if { ${nb_sh} != ${nb_sh_good} } {
75 puts "Error : The resulting shape is WRONG because it must contains ${nb_sh_good} shells instead of ${nb_sh}"
77 puts "The resulting shape contains ${nb_sh} shells"
81 if { [info exists nb_sol_good] } {
82 regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol
83 if { ${nb_sol} != ${nb_sol_good} } {
84 puts "Error : The resulting shape is WRONG because it must contains ${nb_sol_good} solids instead of ${nb_sol}"
86 puts "The resulting shape contains ${nb_sol} solids"
90 if { [info exists nb_compsol_good] } {
91 regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol
92 if { ${nb_compsol} != ${nb_compsol_good} } {
93 puts "Error : The resulting shape is WRONG because it must contains ${nb_compsol_good} compsolids instead of ${nb_compsol}"
95 puts "The resulting shape contains ${nb_compsol} compsolids"
99 if { [info exists nb_compound_good] } {
100 regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound
101 if { ${nb_compound} != ${nb_compound_good} } {
102 puts "Error : The resulting shape is WRONG because it must contains ${nb_compound_good} compounds instead of ${nb_compound}"
104 puts "The resulting shape contains ${nb_compound} compounds"
108 if { [info exists nb_shape_good] } {
109 regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape
110 if { ${nb_shape} != ${nb_shape_good} } {
111 puts "Error : The resulting shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}"
113 puts "The resulting shape contains ${nb_shape} shapes"
123 xwd $imagedir/${test_image}.png
128 xwd $imagedir/${test_image}.png
131 puts "Error : The $command cannot be built."
134 # to end a test script
135 puts "TEST COMPLETED"