mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[ruby/fiddle] Use test-unit gem (https://github.com/ruby/fiddle/pull/69)
e08c4c635e
Co-authored-by: Sutou Kouhei <kou@clear-code.com>
This commit is contained in:
parent
afa33da72b
commit
8f752c95d2
Notes:
git
2021-09-05 19:26:21 +09:00
8 changed files with 79 additions and 37 deletions
|
@ -185,7 +185,16 @@ module Fiddle
|
|||
end if /freebsd/=~ RUBY_PLATFORM
|
||||
|
||||
def test_no_memory_leak
|
||||
assert_no_memory_leak(%w[-W0 -rfiddle.so], '', '100_000.times {Fiddle::Handle.allocate}; GC.start', rss: true)
|
||||
if respond_to?(:assert_nothing_leaked_memory)
|
||||
n_tries = 100_000
|
||||
assert_nothing_leaked_memory(SIZEOF_VOIDP * (n_tries / 100)) do
|
||||
n_tries.times do
|
||||
Fiddle::Handle.allocate
|
||||
end
|
||||
end
|
||||
else
|
||||
assert_no_memory_leak(%w[-W0 -rfiddle.so], '', '100_000.times {Fiddle::Handle.allocate}; GC.start', rss: true)
|
||||
end
|
||||
end
|
||||
|
||||
if /cygwin|mingw|mswin/ =~ RUBY_PLATFORM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue