Adding testing cases from chl group
[occt.git] / tests / bugs / end
CommitLineData
355c1551 1if { [info exists square] } {
2 set prop "square"
3 set mass $square
4 if { [info exists tol_square] } {
5 regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
6 } else {
7 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
8 }
9}
10if { [info exists length] } {
11 set prop "length"
12 set mass $length
13 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
14
15 puts "checksection"
16 puts [checksection result]
17}
18
19#if mass (length or square) is empty in test case then result should be an empty shape.
20if { [info exists mass] } {
21 if { [string compare $subgroup "moddata"] != 0 } {
22 puts "checkshape"
23 checkshape result
24 }
25
26 if { [string compare "$mass" "empty"] != 0 } {
27 if { $m == 0 } {
28 puts "Error : The command is not valid. The $prop is 0."
29 }
30 if { $mass > 0 } {
31 puts "The expected $prop is $mass"
32 }
33 #check of change of square is < 1%
34 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
35 puts "Error : The $prop of result shape is $m"
36 }
37 } else {
38 if { $m != 0 } {
39 puts "Error : The command is not valid. The $prop is $m"
40 }
41 }
42}
43
44set glob_inf [info global nb_*_good]
45if { [regexp "nb_.*_good" $glob_inf] == 1 } {
46 set nb_info [nbshapes result]
47}
48
49if { [info exists nb_v_good] } {
50 regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
51 if { ${nb_v} != ${nb_v_good} } {
52 puts "Error : Result shape is WRONG because it must contains ${nb_v_good} vertexes instead of ${nb_v}"
53 } else {
54 puts "Result shape contains ${nb_v} vertexes"
55 }
56}
57
58if { [info exists nb_e_good] } {
59 regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e
60 if { ${nb_e} != ${nb_e_good} } {
61 puts "Error : Result shape is WRONG because it must contains ${nb_e_good} edges instead of ${nb_e}"
62 } else {
63 puts "Result shape contains ${nb_e} edges"
64 }
65}
66
67if { [info exists nb_w_good] } {
68 regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w
69 if { ${nb_w} != ${nb_w_good} } {
70 puts "Error : Result shape is WRONG because it must contains ${nb_w_good} wires instead of ${nb_w}"
71 } else {
72 puts "Result shape contains ${nb_w} wires"
73 }
74}
75
76if { [info exists nb_f_good] } {
77 regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f
78 if { ${nb_f} != ${nb_f_good} } {
79 puts "Error : Result shape is WRONG because it must contains ${nb_f_good} faces instead of ${nb_f}"
80 } else {
81 puts "Result shape contains ${nb_f} faces"
82 }
83}
84
85if { [info exists nb_sh_good] } {
86 regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh
87 if { ${nb_sh} != ${nb_sh_good} } {
88 puts "Error : Result shape is WRONG because it must contains ${nb_sh_good} shells instead of ${nb_sh}"
89 } else {
90 puts "Result shape contains ${nb_sh} shells"
91 }
92}
93
94if { [info exists nb_sol_good] } {
95 regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol
96 if { ${nb_sol} != ${nb_sol_good} } {
97 puts "Error : Result shape is WRONG because it must contains ${nb_sol_good} solids instead of ${nb_sol}"
98 } else {
99 puts "Result shape contains ${nb_sol} solids"
100 }
101}
102
103if { [info exists nb_compsol_good] } {
104 regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol
105 if { ${nb_compsol} != ${nb_compsol_good} } {
106 puts "Error : Result shape is WRONG because it must contains ${nb_compsol_good} compsolids instead of ${nb_compsol}"
107 } else {
108 puts "Result shape contains ${nb_compsol} compsolids"
109 }
110}
111
112if { [info exists nb_compound_good] } {
113 regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound
114 if { ${nb_compound} != ${nb_compound_good} } {
115 puts "Error : Result shape is WRONG because it must contains ${nb_compound_good} compounds instead of ${nb_compound}"
116 } else {
117 puts "Result shape contains ${nb_compound} compounds"
118 }
119}
120
121if { [info exists nb_shape_good] } {
122 regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape
123 if { ${nb_shape} != ${nb_shape_good} } {
124 puts "Error : Result shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}"
125 } else {
126 puts "Result shape contains ${nb_shape} shapes"
127 }
128}
129
fa920fb1 130if { [isdraw result] } {
131 if { [info exists 2dviewer] } {
132 clear
133 smallview
134 donly result
135 fit
88f8fc81 136 xwd $imagedir/${test_image}.png
fa920fb1 137 }
138 if { [info exists 3dviewer] } {
319e4241 139 vinit
fa920fb1 140 vclear
141 vdisplay result
142 vsetdispmode 1
143 vfit
352ffd73 144 vzfit
88f8fc81 145 vdump $imagedir/${test_image}.png
fa920fb1 146 }
a2d5ab2e 147}
82cbc512 148
149if { [info exist only_screen] } {
355c1551 150 vdump $imagedir/${test_image}.png
82cbc512 151}
fa920fb1 152
aff395a3 153if { [info exist only_screen2d] } {
355c1551 154 v2ddump $imagedir/${test_image}.png
aff395a3 155}
156
fa920fb1 157# to end a test script
158puts "TEST COMPLETED"