Modify test cases according using imagedir folder for saving tmp files
[occt.git] / tests / bugs / caf / bug27604
CommitLineData
bf954475 1puts "========"
2puts "OCC27604"
3puts "Application Framework - memory is not released after closing XBF file"
4puts "========"
5puts ""
6
7set aBigShape Bottom.brep
8
9pload OCAF MODELING
10
11# just a big shape to fit in memory
12restore [locate_data_file $aBigShape] s
13
1dd28279 14file delete ${imagedir}/test.cbf
15
bf954475 16# store it in the document
17NewDocument D BinOcaf
18SetShape D "0:2" s
1dd28279 19SaveAs D ${imagedir}/test.cbf
bf954475 20Close D
21
22# store the memory used before opening a document
23set aBefore [meminfo h]
24
1dd28279 25Open ${imagedir}/test.cbf DD
bf954475 26set aDocLoaded [meminfo h]
27set aBigDelta [expr $aDocLoaded - $aBefore]
28Close DD
29
30set anAfter [meminfo h]
31set aDelta [expr $anAfter - $aBefore]
32
33puts "Memory used before: $aBefore"
34puts "After open: $aDocLoaded"
35puts "After close: $anAfter"
36
37# if after the close the memory used left 5% more than before closed, this is an issue
38# (less 5% is the measurement tolerance)
39if {[expr $aBigDelta / 20. - $aDelta] < 0} {
40 puts "Error: the memory is not freed after Open/Close"
41}