mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
Restoring test cases removed by last commit.
Enabling command QAAIAGetColor2d on Windows in order to allow relevant tests to pass.
This commit is contained in:
parent
57ea2bf0d3
commit
5789daf94d
52
tests/bugs/caf/buc60921
Normal file
52
tests/bugs/caf/buc60921
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
27
tests/bugs/caf/bug114
Normal file
27
tests/bugs/caf/bug114
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
@ -7,15 +7,7 @@ puts ""
|
|||||||
## Raises exception "Standard_NotImplemented3" in GCPnts_AbscissaPoint on a Geom2d_OffsetCurve
|
## Raises exception "Standard_NotImplemented3" in GCPnts_AbscissaPoint on a Geom2d_OffsetCurve
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
if { [array get env os_type] != "" } {
|
set len_expected 4.e100
|
||||||
set os $env(os_type)
|
|
||||||
}
|
|
||||||
if { [string compare $os "windows"] == 0 } {
|
|
||||||
set len_ch 3.9999999999999993e+100
|
|
||||||
} else {
|
|
||||||
set len_ch 4.0000000000000001e+100
|
|
||||||
}
|
|
||||||
|
|
||||||
line line_2d 0 0 1 1
|
line line_2d 0 0 1 1
|
||||||
|
|
||||||
offset result line_2d 10 1 0
|
offset result line_2d 10 1 0
|
||||||
@ -23,6 +15,4 @@ offset result line_2d 10 1 0
|
|||||||
set info [length $result]
|
set info [length $result]
|
||||||
regexp {The length result is +([-0-9.+eE]+)} $info full len
|
regexp {The length result is +([-0-9.+eE]+)} $info full len
|
||||||
|
|
||||||
if { ${len} != ${len_ch} } {
|
checkreal "Length" $len $len_expected 0. 1e-10
|
||||||
puts "Error : Length is invalid"
|
|
||||||
}
|
|
||||||
|
@ -9,7 +9,8 @@ puts ""
|
|||||||
#cpulimit 9000
|
#cpulimit 9000
|
||||||
|
|
||||||
restore [locate_data_file OCC503.brep] result
|
restore [locate_data_file OCC503.brep] result
|
||||||
if [catch {sprops result} catch_result] {
|
|
||||||
|
if [catch {sprops result 0.001 } catch_result] {
|
||||||
set mistake 1
|
set mistake 1
|
||||||
} else {
|
} else {
|
||||||
set mistake 0
|
set mistake 0
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
FAILED /\bFaulty\b/ bad shape
|
FAILED /\bFaulty\b/ bad shape
|
||||||
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
|
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
|
||||||
|
OK /Relative error of mass computation/ message from vprops
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user