0028107: Visualization - provide a flexible interface to set custom hatch styles
[occt.git] / tests / bugs / vis / bug24623_4
CommitLineData
f751596e 1puts "============"
2puts "OCC24623_4"
3puts "============"
4puts ""
5#######################################################################
6puts "Visualization - improve selection mechanism"
7# tests memory leaks in creation of selection primitives for connected
8# interactive objects: checks that there is no "dead links" to reference
9# interactives after its clearing
10#######################################################################
11
12puts ""
13pload MODELING VISUALIZATION
14psphere s 0.5
15tclean s
16incmesh s 0.001
17trinfo s
18vinit
19vclear
20
21set aMemInit [meminfo h]
22set anIterNb 100
23
24for {set anIterCount 0} {$anIterCount < $anIterNb} {incr anIterCount} {
25 set aNb 11
26
27 vconnectto i_1 0 0 0 s -nodisplay
28 vloadselection i_1
29 for {set i 2} {$i < $aNb} {incr i} { vconnectto i_${i} ${i} 0 0 i_1 -nodisplay; vloadselection i_${i} }
30 vclear
31}
32
33set aMemClear [meminfo h]
34
35puts "Initial memory : [expr $aMemInit / (1024 * 1024)] MiB"
36puts "Clearing : [expr $aMemClear / (1024 * 1024)] MiB"
37
38set aRatio [expr $aMemClear / double($aMemInit)]
39
40# check if the memory difference is greater than 20%
41if {[expr $aRatio > 1.2]} {
42 puts "Error : TEST FAILED"
43}