From 1578edbafc8d641a1829cb1949318aa754fc5485 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sun, 25 Oct 2009 00:11:41 +0000 Subject: * ext/dl/handle.c (rb_dlhandle_close_enabled_p) testing that handles can be enabled and disabled for closure on GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dl/test_handle.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/dl') diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb index a8dcf1952b..487b8d1a34 100644 --- a/test/dl/test_handle.rb +++ b/test/dl/test_handle.rb @@ -105,5 +105,22 @@ module DL handle = DL::Handle.new(LIBC_SO, DL::RTLD_LAZY | DL::RTLD_GLOBAL) assert handle['calloc'] end + + def test_enable_close + handle = DL::Handle.new(LIBC_SO) + assert !handle.close_enabled?, 'close is enabled' + + handle.enable_close + assert handle.close_enabled?, 'close is not enabled' + end + + def test_disable_close + handle = DL::Handle.new(LIBC_SO) + + handle.enable_close + assert handle.close_enabled?, 'close is enabled' + handle.disable_close + assert !handle.close_enabled?, 'close is enabled' + end end end -- cgit v1.2.3