Added new swig_gc.rb file to obtain easy stats

from ruby's GC.
Updated newobject1_* tests to use it.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9695 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-04-28 17:29:11 +00:00
commit fd79f15521
3 changed files with 47 additions and 8 deletions

View file

@ -12,18 +12,17 @@
#
require 'swig_assert'
require 'swig_gc'
require 'newobject2'
include Newobject2
stats = nil
stats = GC.stats(stats, Foo)
100.times { foo1 = makeFoo }
stats = GC.stats(stats, Foo)
swig_assert( 'fooCount == 100', "but is #{fooCount}" )
GC.start
swig_assert( 'fooCount == 1', "but is #{fooCount}" )
stats = GC.stats(stats, Foo)
swig_assert( 'fooCount <= 1', "but is #{fooCount}" )
@foos = []
100.times { @foos << makeFoo }
swig_assert( 'fooCount == 101', "but is #{fooCount}" )
GC.start