0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / tests / boolean / end
CommitLineData
40093367 1if { [isdraw result] } {
2 #check if result is valid
3
4 puts "checkshape"
5 set ch [checkshape result]
6 puts $ch
7
8 if { [info exists square] } {
6aac585a 9 set prop "area"
40093367 10 set mass $square
11 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
12 }
13 if { [info exists length] } {
14 set prop "length"
15 set mass $length
16 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
17
18 puts "checksection"
19 puts [checksection result]
20 }
21
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 } {
24 if { $m == 0 } {
25 puts "Error : The $command is not valid. The $prop is 0."
26 }
27 if { $mass > 0 } {
28 puts "The expected $prop is $mass"
29 }
30 #check of change of square is < 1%
49c093ae 31 if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
94a57f1f 32 puts "Error : The $prop of the resulting shape is $m"
40093367 33 }
34
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 } {
94a57f1f 39 puts "Error : The resulting shape is WRONG because it must contain $nbsh_v vertexes instead of $nb_v"
40093367 40 } else {
94a57f1f 41 puts "The resulting shape contains $nb_v vertexes"
40093367 42 }
43
44 }
45
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 } {
94a57f1f 50 puts "Error : The resulting shape is WRONG because it must contain $nbsh_e edges instead of $nb_e"
40093367 51 } else {
94a57f1f 52 puts "The resulting shape contains $nb_e edges"
40093367 53 }
54 }
55 } else {
56 if { $m != 0 } {
57 puts "Error : The $command is not valid. The $prop is $m"
58 }
59 }
60
61 smallview
62 if { $m > 0 } {
63 donly result
64 if { [info exists nbsh_v ] } {
65 explode result v
66 }
67 } else {
68 donly a b
69 }
70 fit
88f8fc81 71 xwd $imagedir/${test_image}.png
40093367 72} else {
94a57f1f 73 puts "Error : The $command cannot be built."
40093367 74}
75
76# to end a test script
77puts "TEST COMPLETED"