From 4203d75d8ece06f2aeea2f4aaee0caf7937730f8 Mon Sep 17 00:00:00 2001 From: pavel Date: Sun, 30 Aug 2020 02:42:08 +0200 Subject: [PATCH] jruby fixes --- spec/ffi/long_double_spec.rb | 2 +- spec/ffi/rbx/attach_function_spec.rb | 2 +- spec/ffi/struct_spec.rb | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/spec/ffi/long_double_spec.rb b/spec/ffi/long_double_spec.rb index 3128d9686..c2b22cf58 100644 --- a/spec/ffi/long_double_spec.rb +++ b/spec/ffi/long_double_spec.rb @@ -47,4 +47,4 @@ module LibTest expect(v).to be_within(0.01).of(0.1) end end -end if RUBY_ENGINE != "truffleruby" +end unless ['truffleruby', 'jruby'].include?(RUBY_ENGINE) diff --git a/spec/ffi/rbx/attach_function_spec.rb b/spec/ffi/rbx/attach_function_spec.rb index 35772a99f..b83f91e9c 100644 --- a/spec/ffi/rbx/attach_function_spec.rb +++ b/spec/ffi/rbx/attach_function_spec.rb @@ -35,4 +35,4 @@ module LibC expect(t[:tv_usec]).to be_kind_of(Numeric) end end -end +end unless RUBY_ENGINE == 'jruby' diff --git a/spec/ffi/struct_spec.rb b/spec/ffi/struct_spec.rb index f1f4bcc5e..d73088a47 100644 --- a/spec/ffi/struct_spec.rb +++ b/spec/ffi/struct_spec.rb @@ -364,13 +364,17 @@ def self.int_field_test(type, values) int_field_test(:int, [ 0, 0x7fffffff, -0x80000000, -1 ]) int_field_test(:uint, [ 0, 0x7fffffff, 0x80000000, 0xffffffff ]) int_field_test(:long_long, [ 0, 0x7fffffffffffffff, -0x8000000000000000, -1 ]) - int_field_test(:ulong_long, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ]) + if RUBY_ENGINE != 'jruby' # https://github.com/jnr/jffi/issues/87 + int_field_test(:ulong_long, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ]) + end if FFI::Platform::LONG_SIZE == 32 int_field_test(:long, [ 0, 0x7fffffff, -0x80000000, -1 ]) int_field_test(:ulong, [ 0, 0x7fffffff, 0x80000000, 0xffffffff ]) else int_field_test(:long, [ 0, 0x7fffffffffffffff, -0x8000000000000000, -1 ]) - int_field_test(:ulong, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ]) + if RUBY_ENGINE != 'jruby' # https://github.com/jruby/jruby/issues/6376 + int_field_test(:ulong, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ]) + end end it ":float field r/w" do