0024156: It's necessary to add TODO in test cases to avoid known regressions on MacOS
[occt.git] / tests / bugs / caf / bug23489
1 puts "TODO OCC24156 MacOS: Tcl Exception: File Bottom.brep could not be found"
2 puts "TODO OCC24156 MacOS: TEST INCOMPLETE"
3
4 # Test for #23489: memory leak in TNaming_NamedShape destructor
5
6 pload OCAF
7
8 # take some big file to be loaded
9 set file [locate_data_file Bottom.brep]
10
11 set listmem {}
12 for {set i 1} {$i < 10} {incr i} {
13     # load big shape
14     restore $file a
15
16     # add shape to new OCAF document
17     NewDocument D MDTV-Standard
18
19     # add shape to document
20     SetShape D 0:1 a
21
22     # Note: if ForgetAll or Undo is called here, memory is correctly freed!
23     # ForgetAll D 0:1
24
25     # close document
26     Close D
27    
28
29     # unload shape (replace by small one)
30     vertex a 0 0 0
31
32     # check memory usage (with tolerance equal to half page size)
33     lappend listmem [meminfo h]
34     if { [checktrend $listmem 0 256 "Memory leak detected"] } {
35         puts "No memory leak, $i iterations"
36         break
37     }
38 }