From 9b74e2071c57b91177f3003366d679d99d3a5d54 Mon Sep 17 00:00:00 2001 From: abv Date: Sun, 8 Apr 2018 18:52:31 +0300 Subject: [PATCH] 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) --- src/DrawResources/CheckCommands.tcl | 10 ++++------ tests/offset/faces_type_i/E5 | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) 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