bfff00a8 |
1 | if { [isdraw result] } { |
2 | |
3 | if { [info exists square] } { |
4 | set prop "square" |
5 | set mass $square |
6 | regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m |
7 | } |
8 | if { [info exists length] } { |
9 | set prop "length" |
10 | set mass $length |
11 | regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m |
12 | } |
13 | if { [info exists mass] } { |
14 | #if mass (length or square) is empty in test case then result should be an empty shape. |
15 | if { [string compare "$mass" "empty"] != 0 } { |
16 | if { $m == 0 } { |
17 | puts "Error : The $command is not valid. The $prop is 0." |
18 | } |
19 | if { $mass > 0 } { |
20 | puts "The expected $prop is $mass" |
21 | } |
22 | #check of change of square is < 1% |
23 | if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } { |
24 | puts "Error : The $prop of result shape is $m" |
25 | } |
26 | } else { |
27 | if { $m != 0 } { |
28 | puts "Error : The $command is not valid. The $prop is $m" |
29 | } |
30 | } |
31 | } |
32 | |
33 | if { [info exists nb_v_good] } { |
34 | regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v |
35 | if { ${nb_v} != ${nb_v_good} } { |
36 | puts "Error : Result shape is WRONG because it must contains ${nb_v_good} vertexes instead of ${nb_v}" |
37 | } else { |
38 | puts "Result shape contains ${nb_v} vertexes" |
39 | } |
40 | } |
41 | |
42 | if { [info exists nb_e_good] } { |
43 | regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e |
44 | if { ${nb_e} != ${nb_e_good} } { |
45 | puts "Error : Result shape is WRONG because it must contains ${nb_e_good} edges instead of ${nb_e}" |
46 | } else { |
47 | puts "Result shape contains ${nb_e} edges" |
48 | } |
49 | } |
50 | |
51 | if { [info exists nb_w_good] } { |
52 | regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w |
53 | if { ${nb_w} != ${nb_w_good} } { |
54 | puts "Error : Result shape is WRONG because it must contains ${nb_w_good} wires instead of ${nb_w}" |
55 | } else { |
56 | puts "Result shape contains ${nb_w} wires" |
57 | } |
58 | } |
59 | |
60 | if { [info exists nb_f_good] } { |
61 | regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f |
62 | if { ${nb_f} != ${nb_f_good} } { |
63 | puts "Error : Result shape is WRONG because it must contains ${nb_f_good} faces instead of ${nb_f}" |
64 | } else { |
65 | puts "Result shape contains ${nb_f} faces" |
66 | } |
67 | } |
68 | |
69 | if { [info exists nb_sh_good] } { |
70 | regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh |
71 | if { ${nb_sh} != ${nb_sh_good} } { |
72 | puts "Error : Result shape is WRONG because it must contains ${nb_sh_good} shells instead of ${nb_sh}" |
73 | } else { |
74 | puts "Result shape contains ${nb_sh} shells" |
75 | } |
76 | } |
77 | |
78 | if { [info exists nb_sol_good] } { |
79 | regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol |
80 | if { ${nb_sol} != ${nb_sol_good} } { |
81 | puts "Error : Result shape is WRONG because it must contains ${nb_sol_good} solids instead of ${nb_sol}" |
82 | } else { |
83 | puts "Result shape contains ${nb_sol} solids" |
84 | } |
85 | } |
86 | |
87 | if { [info exists nb_compsol_good] } { |
88 | regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol |
89 | if { ${nb_compsol} != ${nb_compsol_good} } { |
90 | puts "Error : Result shape is WRONG because it must contains ${nb_compsol_good} compsolids instead of ${nb_compsol}" |
91 | } else { |
92 | puts "Result shape contains ${nb_compsol} compsolids" |
93 | } |
94 | } |
95 | |
96 | if { [info exists nb_compound_good] } { |
97 | regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound |
98 | if { ${nb_compound} != ${nb_compound_good} } { |
99 | puts "Error : Result shape is WRONG because it must contains ${nb_compound_good} compounds instead of ${nb_compound}" |
100 | } else { |
101 | puts "Result shape contains ${nb_compound} compounds" |
102 | } |
103 | } |
104 | |
105 | if { [info exists nb_shape_good] } { |
106 | regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape |
107 | if { ${nb_shape} != ${nb_shape_good} } { |
108 | puts "Error : Result shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}" |
109 | } else { |
110 | puts "Result shape contains ${nb_shape} shapes" |
111 | } |
112 | } |
113 | |
114 | } |