diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 00:11:41 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-25 00:11:41 +0000 |
commit | 1578edbafc8d641a1829cb1949318aa754fc5485 (patch) | |
tree | b355dd2dea9b73d02eb4de4b0d7f7c11a40bc9df /test/dl | |
parent | 159e6439c0d94d0f2c0dffdfe0d76aad631eb876 (diff) | |
download | bundler-1578edbafc8d641a1829cb1949318aa754fc5485.tar.gz |
* 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
Diffstat (limited to 'test/dl')
-rw-r--r-- | test/dl/test_handle.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 |