diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-09 04:19:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-09 04:19:10 +0000 |
commit | cb05f199ee303448129a84d07a2ca698890f4c1f (patch) | |
tree | df3b79f04b4d5e1fab5718456faa990c62347cd3 /test/dl | |
parent | e20cd8ee490537127fa07e22991bdc22402953e4 (diff) | |
download | ruby-cb05f199ee303448129a84d07a2ca698890f4c1f.tar.gz |
tests for [Bug #9599]
* test/dl/test_{cptr,handle}.rb: tests for [Bug #9599].
* test/fiddle/test_{handle,pointer}.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dl')
-rw-r--r-- | test/dl/test_cptr.rb | 4 | ||||
-rw-r--r-- | test/dl/test_handle.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb index c3793859d7..13700cb3f2 100644 --- a/test/dl/test_cptr.rb +++ b/test/dl/test_cptr.rb @@ -219,4 +219,8 @@ module DL assert_raise(DLError) {nullpo[0] = 1} end end + + def test_no_memory_leak + assert_no_memory_leak(%w[-W0 -rdl.so], '', '100_000.times {DL::CPtr.allocate}', limit: 1.2) + end end diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb index 83b8af1960..fc5053a87e 100644 --- a/test/dl/test_handle.rb +++ b/test/dl/test_handle.rb @@ -184,4 +184,8 @@ module DL DL.dlopen("/lib/libc.so.7").sym('strcpy') end if /freebsd/=~ RUBY_PLATFORM end + + def test_no_memory_leak + assert_no_memory_leak(%w[-W0 -rdl.so], '', '100_000.times {DL::Handle.allocate}; GC.start', limit: 1.2) + end end |