]> OCCT Git - occt.git/commitdiff
0029680: Tests - command checkprops does not work for negative values
authorabv <abv@opencascade.com>
Sun, 8 Apr 2018 15:52:31 +0000 (18:52 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 9 Apr 2018 08:07:41 +0000 (11:07 +0300)
DRAW command checkprops is corrected to handle properly negative reference values.

Test case offset faces_face_i E5 is corrected (improvement due to #28903)

src/DrawResources/CheckCommands.tcl
tests/offset/faces_type_i/E5

index 668e59ef316f4cbf92be1d1b7558bbf05c197443..b4489a168685a620bd71aea187ddba0cd0f7aad2 100644 (file)
@@ -595,12 +595,10 @@ proc checkprops {shape args} {
                 if { $m == 0 } {
                     puts "Error : The command is not valid. The $prop is 0."
                 }
-                if { $mass > 0 } {
-                    puts "The expected $prop is $mass"
-                }
-                #check of change of area is < 1%
-                if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > $depsilon) || ($mass == 0 && $m != 0) } {
-                    puts "Error : The $prop of result shape is $m"
+                # check of change of area is < 1%
+                if { ($mass != 0 && abs (($mass - $m) / double($mass)) > $depsilon) || 
+                     ($mass == 0 && $m != 0) } {
+                    puts "Error : The $prop of result shape is $m, expected $mass"
                 }
             } else {
                 if { $m != 0 } {
index 8031e2b66fa47dffac9c35075644f47b6347a1ba..59ae8f865392bcab238fc3e442b30faea053db41 100644 (file)
@@ -2,4 +2,4 @@ ptorus s 20 5  270
 
 OFFSETSHAPE 1 {s_2 s_3} $calcul $type
 
-checkprops result -v -3702.54
+checkprops result -v 3256.97