From 88fa99adc880b2ac82d0e963c065c7add65e2137 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Tue, 18 Apr 2023 16:25:32 +0200 Subject: Skip struct specs on Ruby-3.0 It is incompatible to our usage of instance variables by the Struct class. --- spec/ffi/struct_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/ffi/struct_spec.rb b/spec/ffi/struct_spec.rb index 897e083..0429dd5 100644 --- a/spec/ffi/struct_spec.rb +++ b/spec/ffi/struct_spec.rb @@ -467,6 +467,8 @@ module StructSpecsStructTests end it "Can use CallbackInfo struct field in Ractor", :ractor do + skip "sharing structs accross Ractors requires Ruby-3.1" if RUBY_VERSION < "3.1" + res = Ractor.new do s = CallbackMember::TestStruct.new add_proc = lambda { |a, b| a + b } @@ -560,11 +562,13 @@ module StructSpecsStructTests end it "should be usable with Ractor", :ractor do + skip "Using structs in Ractor requires Ruby-3.1" if RUBY_VERSION < "3.1" + class TestStructRactor < FFI::Struct layout :i, :int end - res = Ractor.new(@conninfo) do |conninfo| + res = Ractor.new do s = TestStructRactor.new s[:i] = 0x14 LibTest.ptr_ret_int32_t(s, 0) -- cgit v1.2.1