diff options
author | Sutou Kouhei <[email protected]> | 2024-10-10 14:37:12 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-10-16 11:24:25 +0900 |
commit | 8d127c9b592c58c858a57af6a4a0d805491b5d2b (patch) | |
tree | 3d54e6c2a4e7d23194a993214112524563eb7ce5 /test/fiddle/test_function.rb | |
parent | bbd5b8ddae7b3ff7205866d54cf8aca065a6d9bd (diff) |
Use JRuby implementation for TruffleRuby (#149)
Fix GH-145
Rename `lib/fiddle/jruby.rb` to `lib/fiddle/ffi_backend.rb` as a generic
ffi gem API based implementation.
JRuby and TruffleRuby use `lib/fiddle/ffi_backend.rb`.
---------
Co-authored-by: Benoit Daloze <[email protected]>
Diffstat (limited to 'test/fiddle/test_function.rb')
-rw-r--r-- | test/fiddle/test_function.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/fiddle/test_function.rb b/test/fiddle/test_function.rb index b4b2df2874..6ec40bee06 100644 --- a/test/fiddle/test_function.rb +++ b/test/fiddle/test_function.rb @@ -41,6 +41,9 @@ module Fiddle if RUBY_ENGINE == "jruby" omit("rb_str_dup() doesn't exist in JRuby") end + if RUBY_ENGINE == "truffleruby" + omit("rb_str_dup() doesn't work with TruffleRuby") + end libruby = Fiddle.dlopen(nil) rb_str_dup = Function.new(libruby['rb_str_dup'], @@ -109,8 +112,8 @@ module Fiddle end def test_last_error - if RUBY_ENGINE == "jruby" - omit("Fiddle.last_error doesn't work with JRuby") + if ffi_backend? + omit("Fiddle.last_error doesn't work with FFI backend") end func = Function.new(@libc['strcpy'], [TYPE_VOIDP, TYPE_VOIDP], TYPE_VOIDP) @@ -219,6 +222,9 @@ module Fiddle if RUBY_ENGINE == "jruby" omit("rb_obj_frozen_p() doesn't exist in JRuby") end + if RUBY_ENGINE == "truffleruby" + omit("memory leak detection is fragile with TruffleRuby") + end if respond_to?(:assert_nothing_leaked_memory) rb_obj_frozen_p_symbol = Fiddle.dlopen(nil)["rb_obj_frozen_p"] |