0029133: Unstable test cases
[occt.git] / tests / bugs / vis / bug27318
CommitLineData
53a1447a 1puts "TODO OCC27318 MacOS: Error : TEST FAILED"
2
4c0d97ac 3puts "========"
4puts "OCC27318"
5puts "========"
6puts ""
7##################################################################
8puts "Memory is not released in Select3D_SensitiveSet when destroying AIS_InteractiveContext without removing objects"
9##################################################################
10
11pload VISUALIZATION QAcommands
12
13# to measure initial memory correctly, open and close interactive context
14# to load FreeImage
15vinit
16vclose
17set aMemInit [meminfo h]
18puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])"
19
20# create a box and display it in each interactive context. The context is
21# the only instance that references to the box. Therefore, the box must be
22# removed completely after each context's closing
23for {set anIter 0} {$anIter < 300} {incr anIter} {
24 vinit
25 OCC27318
26 vclose
27}
28
29set aMemAfter [meminfo h]
30puts "Memory after closing interactive context several times: [expr $aMemAfter / (1024 * 1024)] MiB ([expr $aMemAfter])"
31
32set aRatio [expr $aMemAfter / double($aMemInit)]
33
34# check if the memory difference is greater than 5%
35if [expr $aRatio > 1.05] {
36 puts "Error : TEST FAILED"
37}