0025987: Integration part of modified unstable test cases
[occt.git] / tests / bugs / caf / bug23489
CommitLineData
deb26df7
RL
1# Test for #23489: memory leak in TNaming_NamedShape destructor
2
3pload OCAF
4
351bbcba 5# take some big file to be loaded
6set file [locate_data_file Bottom.brep]
7
deb26df7
RL
8set listmem {}
9for {set i 1} {$i < 10} {incr i} {
10 # load big shape
351bbcba 11 restore $file a
deb26df7
RL
12
13 # add shape to new OCAF document
14 NewDocument D MDTV-Standard
15
16 # add shape to document
17 SetShape D 0:1 a
18
19 # Note: if ForgetAll or Undo is called here, memory is correctly freed!
20 # ForgetAll D 0:1
21
22 # close document
23 Close D
24de79c3 24
deb26df7
RL
25
26 # unload shape (replace by small one)
27 vertex a 0 0 0
28
29 # check memory usage (with tolerance equal to half page size)
67a1064e 30 lappend listmem [meminfo h]
9aa684ed 31 checktrend $listmem 0 256 "Memory leak detected"
deb26df7 32}