summaryrefslogtreecommitdiff
path: root/test/dl
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 10:15:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 10:15:38 +0000
commit7eb7f063a4ff88ca08e2abe0d2f190cec50107dc (patch)
treee3a27509c1fca1b8fb9de90e55f6ea7c8b1a369c /test/dl
parent20eebb8542143ffbccbace932ca0277ee16cf6f0 (diff)
Fix test to follow the behavior of NetBSD's dlsym.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dl')
-rw-r--r--test/dl/test_handle.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/dl/test_handle.rb b/test/dl/test_handle.rb
index a128805..75edb10 100644
--- a/test/dl/test_handle.rb
+++ b/test/dl/test_handle.rb
@@ -23,8 +23,16 @@ module DL
def test_static_sym
skip "DL::Handle.sym is not supported" if /mswin|mingw/ =~ RUBY_PLATFORM
- assert_not_nil DL::Handle.sym('dlopen')
- assert_equal DL::Handle.sym('dlopen'), DL::Handle['dlopen']
+ begin
+ # Linux / Darwin / FreeBSD
+ assert_not_nil DL::Handle.sym('dlopen')
+ assert_equal DL::Handle.sym('dlopen'), DL::Handle['dlopen']
+ rescue
+ # NetBSD
+ require 'objspace'
+ assert_not_nil DL::Handle.sym('Init_objspace')
+ assert_equal DL::Handle.sym('Init_objspace'), DL::Handle['Init_objspace']
+ end
end
def test_sym_closed_handle