]> OCCT Git - occt.git/commitdiff
0028841: testdiff DRAW command hangs or crash with arithmetical exception
authorapv <apv@opencascade.com>
Mon, 19 Jun 2017 13:37:39 +0000 (16:37 +0300)
committerapv <apv@opencascade.com>
Mon, 19 Jun 2017 13:37:39 +0000 (16:37 +0300)
src/DrawResources/TestCommands.tcl

index fb2b3deba9e55d1ab4d41fe82210a77f88ca54c6..1f800a9e956f50cfd05f717028fd0c6308729745 100644 (file)
@@ -1873,7 +1873,11 @@ proc _diff_img_name {dir1 dir2 casepath imgfile} {
 
 # auxiliary procedure to produce string comparing two values
 proc _diff_show_ratio {value1 value2} {
-    return "$value1 / $value2 \[[format "%+5.2f%%" [expr 100 * ($value1 - $value2) / double($value2)]]\]"
+    if {[expr double ($value2)] == 0.} {
+        return "$value1 / $value2"
+    } else {
+        return "$value1 / $value2 \[[format "%+5.2f%%" [expr 100 * ($value1 - $value2) / double($value2)]]\]"
+    }
 }
 
 # procedure to check cpu user time