40093367 |
1 | if { [isdraw result] } { |
2 | regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m |
3 | |
4 | #check if result is valid |
5 | puts [checkshape result] |
6 | if { $m == 0 } { |
94a57f1f |
7 | puts "Error: The pipe is invalid. The area is 0." |
40093367 |
8 | } |
9 | |
10 | if { $square > 0 } { |
94a57f1f |
11 | puts "The expected area is $square" |
40093367 |
12 | } |
13 | #check of change of square is < 1% |
49c093ae |
14 | if { ($square != 0 && [expr 1.*abs($square - $m)/$square] > 0.01) || ($square == 0 && $m != 0) } { |
94a57f1f |
15 | puts "Error : The area of the resulting shape is $m" |
40093367 |
16 | } |
17 | if { $m > 0 } { |
18 | clear |
19 | smallview |
20 | donly result |
21 | fit |
88f8fc81 |
22 | xwd $imagedir/${test_image}.png |
40093367 |
23 | } |
24 | } else { |
94a57f1f |
25 | puts "Error : The pipe cannot be built." |
40093367 |
26 | } |
27 | |
28 | # to end a test script |
29 | puts "TEST COMPLETED" |