| 1 | #set length 0 |
| 2 | if { [isdraw result] } { |
| 3 | #check if result is valid |
| 4 | |
| 5 | puts [checkshape result] |
| 6 | |
| 7 | set prop "length" |
| 8 | set mass $length |
| 9 | regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m |
| 10 | |
| 11 | if { [string compare "$mass" "empty"] != 0 } { |
| 12 | if { $m == 0 } { |
| 13 | puts "Error : The $command is not valid. The $prop is 0." |
| 14 | } |
| 15 | if { $mass > 0 } { |
| 16 | puts "The expected $prop is $mass" |
| 17 | } |
| 18 | #check of change of length is < 1% |
| 19 | if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } { |
| 20 | puts "Error : The $prop of the resulting shape is $m" |
| 21 | } |
| 22 | } else { |
| 23 | if { $m != 0 } { |
| 24 | puts "Error : The $command is not valid. The $prop is $m" |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | if { $m > 0 } { |
| 29 | smallview |
| 30 | clear |
| 31 | donly result |
| 32 | fit |
| 33 | xwd $imagedir/${test_image}.png |
| 34 | } else { |
| 35 | smallview |
| 36 | clear |
| 37 | fit |
| 38 | xwd $imagedir/${test_image}.png |
| 39 | } |
| 40 | } else { |
| 41 | puts "Error : The $command cannot be built." |
| 42 | } |
| 43 | |
| 44 | # to end a test script |
| 45 | puts "TEST COMPLETED" |