summaryrefslogtreecommitdiff
path: root/test/dl
diff options
context:
space:
mode:
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_cptr.rb4
-rw-r--r--test/dl/test_handle.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb
index c3793859d7..aa74a73fe5 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}', rss: true)
+ end
end
diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb
index 83b8af1960..6a8964e9a0 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', rss: true)
+ end
end