summaryrefslogtreecommitdiff
path: root/test/dl/test_handle.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 00:11:41 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 00:11:41 +0000
commit1578edbafc8d641a1829cb1949318aa754fc5485 (patch)
treeb355dd2dea9b73d02eb4de4b0d7f7c11a40bc9df /test/dl/test_handle.rb
parent159e6439c0d94d0f2c0dffdfe0d76aad631eb876 (diff)
* 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/test_handle.rb')
-rw-r--r--test/dl/test_handle.rb17
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