0025138: SIGSEGV when sweeping along helix
[occt.git] / tests / bugs / begin
index 4d7a00a..c80b246 100755 (executable)
@@ -1,15 +1,16 @@
 # File : begin
+
 if { [array get Draw_Groups "TOPOLOGY Check commands"] == "" } {
     pload TOPTEST
     pload VISUALIZATION
-#    set env(CSF_DrawPluginQADefaults) $env(CASROOT)/src/DrawResources/.
-#    pload QAcommands
-#    pload -DrawPluginQA QAcommands
 }
 
 # to prevent loops limit to 16 minutes
 cpulimit 1000
 
+set rel_tol 0
+set max_rel_tol_diff 0
+
 # On Windows with VC, in typical configuration gl2ps is built with Release
 # mode only which will fail in Debug mode; add TODO for that case in order
 # to handle it once for all tests that can use vexport command
@@ -25,17 +26,6 @@ if { [info exists test_image] == 0 } {
    set test_image photo
 }
 
-# Procedure to check equality of two reals with tolerance (relative and absolute)
-help checkreal {name value expected tol_abs tol_rel}
-proc checkreal {name value expected tol_abs tol_rel} {
-    if { abs ($value - $expected) > $tol_abs + $tol_rel * abs ($expected) } {
-        puts "Error: $name = $value is not equal to expected $expected"
-    } else {
-        puts "Check of $name OK: value = $value, expected = $expected"
-    }
-    return
-}
-
 # Procedure to check equality of two reals with tolerance (relative and absolute)
 help checkarea {shape area_expected tol_abs tol_rel}
 proc checkarea {shape area_expected tol_abs tol_rel} {
@@ -117,54 +107,16 @@ proc CheckTriArea {shape {eps 0}} {
   expr ($t_area - $g_area) / $g_area * 100
 }
 
-# Check if list of xdistcs-command is valid
-proc checkList {List Tolerance D_good Limit_Tol} {
-   set L1 [llength ${List}]
-   set L2 10
-   set L3 5
-   set N [expr (${L1} - ${L2})/${L3} + 1]
-
-   for {set i 1} {${i} <= ${N}} {incr i} {
-      set j1 [expr ${L2} + (${i}-1)*${L3}]
-      set j2 [expr ${j1} + 2]
-      set T [lindex ${List} ${j1}]
-      set D [lindex ${List} ${j2}]
-      #puts "i=${i} j1=${j1} j2=${j2} T=${T} D=${D}"
-      if { [expr abs(${D} - ${D_good})] > ${Tolerance} } {
-         puts "Error : T=${T} D=${D}"
-      }
-      
-      if { ${Tolerance} > ${Limit_Tol} } {
-        if { [expr abs(${D} - ${D_good})] > ${Limit_Tol} 
-             && [expr abs(${D} - ${D_good})] <= ${Tolerance} } {
-           puts "Attention (critical value of tolerance) : T=${T} D=${D}"
-        }
-      }
+# Check expected time
+proc checktime {value expected tol_rel message} {
+   set t1 [expr ${value} - ${expected}]
+   set t2 [expr ${expected} * abs (${tol_rel})]
+
+   if { abs (${t1}) <= ${t2} } {                                         
+      puts "OK. ${message}, ${value} seconds, is equal to expected time - ${expected} seconds"
+   } elseif {${t1} > ${t2}} {
+      puts "Error. ${message}, ${value} seconds, is more than expected time - ${expected} seconds"
+   } else {
+      puts "Improvement. ${message}, ${value} seconds, is less than expected time - ${expected} seconds"
    }
 }
-
-# Procedure to check result of nbshapes command
-proc checknbshapes { res nbshapes_expected_s count_locations message} {
-
-    upvar $res shape
-    if { ${count_locations} == 0 } {
-      set nb_info [nbshapes shape]
-    } else {
-      set nb_info [nbshapes shape -t]
-    }
-
-    set EntityList {VERTEX EDGE WIRE FACE SHELL SOLID COMPSOLID COMPOUND SHAPE}
-
-    foreach Entity ${EntityList} {
-       set expr_string "${Entity} +: +(\[-0-9.+eE\]+)"
-       if { [regexp "${expr_string}" ${nbshapes_expected_s} full nb_entity1] > 0 } {
-                 if { [regexp "${expr_string}" ${nb_info} full nb_entity2] > 0 } {
-            if { ${nb_entity2} != ${nb_entity1} } {
-               puts "Error : ${message} is WRONG because number of ${Entity} entities is ${nb_entity2} while ${nb_entity1} is expected"
-            } else {
-               puts "OK : ${message} is GOOD because number of ${Entity} entities is equal to number of expected ${Entity} entities"
-            }
-                 }
-       }
-    }
-}