From: abv Date: Sun, 8 Apr 2018 15:52:31 +0000 (+0300) Subject: 0029680: Tests - command checkprops does not work for negative values X-Git-Tag: V7_3_0_beta~12 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=9b74e2071c57b91177f3003366d679d99d3a5d54;p=occt.git 0029680: Tests - command checkprops does not work for negative values DRAW command checkprops is corrected to handle properly negative reference values. Test case offset faces_face_i E5 is corrected (improvement due to #28903) --- diff --git a/src/DrawResources/CheckCommands.tcl b/src/DrawResources/CheckCommands.tcl index 668e59ef31..b4489a1686 100644 --- a/src/DrawResources/CheckCommands.tcl +++ b/src/DrawResources/CheckCommands.tcl @@ -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 } { diff --git a/tests/offset/faces_type_i/E5 b/tests/offset/faces_type_i/E5 index 8031e2b66f..59ae8f8653 100644 --- a/tests/offset/faces_type_i/E5 +++ b/tests/offset/faces_type_i/E5 @@ -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