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 | 041f92d1e68101d1c4290f6252a3053a7a11767a (patch) | |
tree | b355dd2dea9b73d02eb4de4b0d7f7c11a40bc9df /test | |
parent | adc30d563b2c211261357376a48f26293212befc (diff) | |
download | ruby-041f92d1e68101d1c4290f6252a3053a7a11767a.tar.gz ruby-041f92d1e68101d1c4290f6252a3053a7a11767a.tar.xz ruby-041f92d1e68101d1c4290f6252a3053a7a11767a.zip |
* ext/dl/handle.c (rb_dlhandle_close_enabled_p) testing that handles can
be enabled and disabled for closure on GC.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 a8dcf1952..487b8d1a3 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 |