Fixed ruby's newobject1 and newobject2 demos.
Added swig_assert.rb and started using it in some tests. Added my patches to ruby.cxx, rubyrun.swg, rubystrings.swg and rubytracking.swg [see: sourceforge] git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4f984a5f82
commit
4b8d11d0e2
111 changed files with 1309 additions and 50 deletions
|
|
@ -1,15 +1,29 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Ruby's GC is somewhat broken in that it will mark some more stack space
|
||||
# leading to the collection of local objects to be delayed.
|
||||
# Thus, upon invokation, it sometimes you can wait up to several
|
||||
# instructions to kick in.
|
||||
# See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7449
|
||||
#
|
||||
# Author:: gga
|
||||
# Copyright:: 2007
|
||||
# License:: SWIG
|
||||
#
|
||||
|
||||
require 'swig_assert'
|
||||
require 'newobject2'
|
||||
|
||||
include Newobject2
|
||||
|
||||
foo1 = makeFoo
|
||||
raise RuntimeError if fooCount != 1
|
||||
|
||||
foo2 = makeFoo
|
||||
raise RuntimeError if fooCount != 2
|
||||
100.times { foo1 = makeFoo }
|
||||
GC.start
|
||||
swig_assert( 'fooCount == 1', "but is #{fooCount}" )
|
||||
|
||||
foo1 = nil ; GC.start
|
||||
raise RuntimeError if fooCount != 1
|
||||
|
||||
foo2 = nil ; GC.start
|
||||
raise RuntimeError if fooCount != 0
|
||||
@foos = []
|
||||
100.times { @foos << makeFoo }
|
||||
swig_assert( 'fooCount == 101', "but is #{fooCount}" )
|
||||
|
||||
GC.start
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue