0023434: Generate images in lossless format (PNG) instead of lossy GIF currently...
[occt.git] / tests / thrusection / end
1 #set square 0
2 if { [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 1.*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}.png
33    } else {
34       smallview
35       clear
36       fit
37       xwd $imagedir/${test_image}.png
38    }
39 } else {
40    puts "Error : The $command can not be build."
41 }
42
43 # to end a test script
44 puts "TEST COMPLETED"