Enabling command QAAIAGetColor2d on Windows in order to allow relevant tests to pass.
--- /dev/null
+# 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
+ }
+}
--- /dev/null
+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
+ }
+}
## 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
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
#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
FAILED /\bFaulty\b/ bad shape
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
-
-
-
+OK /Relative error of mass computation/ message from vprops