Restoring test cases removed by last commit.
[occt.git] / tests / bugs / caf / bug114
diff --git a/tests/bugs/caf/bug114 b/tests/bugs/caf/bug114
new file mode 100644 (file)
index 0000000..c82cef8
--- /dev/null
@@ -0,0 +1,27 @@
+puts "==========="
+puts "OCC114"
+puts "==========="
+
+# Max number of iterations for computing memory leackage
+set i_max 20
+puts "Amount of iterations is $i_max"
+
+NewDocument D MDTV-Standard
+UndoLimit D 10
+
+restore [locate_data_file OCC114.brep] s
+
+set listmem {}
+for {set i 1} {${i} <= ${i_max}} {incr i} {
+
+    OpenCommand D
+    SetShape D 0:1 s 
+    AbortCommand D
+
+    # check memory usage (with tolerance equal to half page size)
+    lappend listmem [expr [meminfo w] / 1024]
+    if { [checktrend $listmem 0 1 "Memory leak detected"] } {
+        puts "No memory leak, $i iterations"
+        break
+    }
+}