0023273: Avoid failures due to datadir commend when data files are not present
[occt.git] / tests / thrusection / end
CommitLineData
40093367 1#set square 0
2if { [isdraw result] } {
3 #check if result is valid
4
5 puts [checkshape result]
6 set prop "square"
7 set mass $square
8 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
9
10 if { [string compare "$mass" "empty"] != 0 } {
11 if { $m == 0 } {
12 puts "Error : The $command is not valid. The $prop is 0."
13 }
14 if { $mass > 0 } {
15 puts "The expected $prop is $mass"
16 }
17 #check of change of square is < 1%
18 if { ($mass != 0 && [expr abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
19 puts "Error : The $prop of result shape is $m"
20 }
21 } else {
22 if { $m != 0 } {
23 puts "Error : The $command is not valid. The $prop is $m"
24 }
25 }
26
27 if { $m > 0 } {
28 smallview
29 clear
30 donly result
31 fit
32 xwd $imagedir/${test_image}.gif
33 } else {
34 smallview
35 clear
36 fit
37 xwd $imagedir/${test_image}.gif
38 }
39} else {
40 puts "Error : The $command can not be build."
41}
42
43# to end a test script
44puts "TEST COMPLETED"