From 5789daf94d91e4f65a17457e3e4711f55358855c Mon Sep 17 00:00:00 2001 From: abv Date: Mon, 10 Dec 2012 19:53:29 +0400 Subject: [PATCH] Restoring test cases removed by last commit. Enabling command QAAIAGetColor2d on Windows in order to allow relevant tests to pass. --- tests/bugs/caf/buc60921 | 52 +++++++++++++++++++++++++++++++++++++++ tests/bugs/caf/bug114 | 27 ++++++++++++++++++++ tests/bugs/moddata/bug143 | 14 ++--------- tests/bugs/moddata/bug503 | 3 ++- tests/bugs/parse.rules | 4 +-- 5 files changed, 84 insertions(+), 16 deletions(-) create mode 100644 tests/bugs/caf/buc60921 create mode 100644 tests/bugs/caf/bug114 diff --git a/tests/bugs/caf/buc60921 b/tests/bugs/caf/buc60921 new file mode 100644 index 0000000000..18579f5d06 --- /dev/null +++ b/tests/bugs/caf/buc60921 @@ -0,0 +1,52 @@ +# This TCL script demonstrates memory leak in OCAF Undo/Redo +# +# The DRAW command TestOCAF (provided separately) just reads +# the specified brep file +# and puts it into the document on a given label. +# This operation is done and undone several times, +# and the problem is that each time additional memory +# (approximately equivalent to the size of shape) +# is consumed. +# +# While obviously it should not be so: even if Undo keeps the +# shape in memory as delta on Redo, this delta should be cleared +# by the next operation! +# +# The bug persists with any setting of variables MMGT_OPT and MMGT_MMAP +# (while with different initial size and step) and +# +# It seems that either delta is not completely freed, or some +# other data structures keep the shape memory + +puts "===========" +puts "BUC60921" +puts "BUC60954" +puts "===========" + +pload QAcommands + +# see end of script! +set BREP [locate_data_file BUC60921.brep] +#set BREP [locate_data_file Bottom.brep] + +NewDocument D MDTV-Standard +UndoLimit D 100 + +set i_max 10 +set listmem {} +for {set i 1} {$i <= ${i_max}} {incr i} { + CommitCommand D + OpenCommand D + BUC60921 D 0:1:1 $BREP + + CommitCommand D + OpenCommand D + Undo D + + # check memory usage (with tolerance equal to half page size) + lappend listmem [expr [meminfo w] / 1024] + if { [checktrend $listmem 0 512 "Memory leak detected"] } { + puts "No memory leak, $i iterations" + break + } +} diff --git a/tests/bugs/caf/bug114 b/tests/bugs/caf/bug114 new file mode 100644 index 0000000000..c82cef86e3 --- /dev/null +++ b/tests/bugs/caf/bug114 @@ -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 + } +} diff --git a/tests/bugs/moddata/bug143 b/tests/bugs/moddata/bug143 index 717c6f0de3..a76fd4a84e 100755 --- a/tests/bugs/moddata/bug143 +++ b/tests/bugs/moddata/bug143 @@ -7,15 +7,7 @@ puts "" ## Raises exception "Standard_NotImplemented3" in GCPnts_AbscissaPoint on a Geom2d_OffsetCurve ###################################################################### -if { [array get env os_type] != "" } { - set os $env(os_type) -} -if { [string compare $os "windows"] == 0 } { - set len_ch 3.9999999999999993e+100 -} else { - set len_ch 4.0000000000000001e+100 -} - +set len_expected 4.e100 line line_2d 0 0 1 1 offset result line_2d 10 1 0 @@ -23,6 +15,4 @@ offset result line_2d 10 1 0 set info [length $result] regexp {The length result is +([-0-9.+eE]+)} $info full len -if { ${len} != ${len_ch} } { - puts "Error : Length is invalid" -} +checkreal "Length" $len $len_expected 0. 1e-10 diff --git a/tests/bugs/moddata/bug503 b/tests/bugs/moddata/bug503 index c6e95d3bc1..5195d81b50 100755 --- a/tests/bugs/moddata/bug503 +++ b/tests/bugs/moddata/bug503 @@ -9,7 +9,8 @@ puts "" #cpulimit 9000 restore [locate_data_file OCC503.brep] result -if [catch {sprops result} catch_result] { + +if [catch {sprops result 0.001 } catch_result] { set mistake 1 } else { set mistake 0 diff --git a/tests/bugs/parse.rules b/tests/bugs/parse.rules index 6f6569ccd1..e00d71107a 100755 --- a/tests/bugs/parse.rules +++ b/tests/bugs/parse.rules @@ -1,5 +1,3 @@ FAILED /\bFaulty\b/ bad shape IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command - - - +OK /Relative error of mass computation/ message from vprops -- 2.20.1