[前][次][番号順一覧][スレッド一覧]

ruby-changes:68112

From: Nobuyoshi <ko1@a...>
Date: Fri, 24 Sep 2021 20:42:42 +0900 (JST)
Subject: [ruby-changes:68112] 225a29b9bc (master): FL_USER flags on ohter than T_DATA are reserved [Misc #18059]

https://git.ruby-lang.org/ruby.git/commit/?id=225a29b9bc

From 225a29b9bc200f09ee56ce7b5221245709f64e4c Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 24 Sep 2021 19:23:15 +0900
Subject: FL_USER flags on ohter than T_DATA are reserved [Misc #18059]

---
 spec/ruby/optional/capi/rbasic_spec.rb   | 20 ++++++++++++++++++++
 spec/ruby/optional/capi/shared/rbasic.rb | 20 --------------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/spec/ruby/optional/capi/rbasic_spec.rb b/spec/ruby/optional/capi/rbasic_spec.rb
index 691c425..6300680 100644
--- a/spec/ruby/optional/capi/rbasic_spec.rb
+++ b/spec/ruby/optional/capi/rbasic_spec.rb
@@ -20,4 +20,24 @@ describe "RBasic support for RData" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/rbasic_spec.rb#L20
     @data = -> { [@wrapping.wrap_struct(1024), @wrapping.wrap_struct(1025)] }
   end
   it_should_behave_like :rbasic
+
+  it "supports user flags" do
+    obj, _ = @data.call
+    initial = @specs.get_flags(obj)
+    @specs.set_flags(obj, 1 << 14 | 1 << 16 | initial).should == 1 << 14 | 1 << 16 | initial
+    @specs.get_flags(obj).should == 1 << 14 | 1 << 16 | initial
+    @specs.set_flags(obj, initial).should == initial
+  end
+
+  it "supports copying the flags from one object over to the other" do
+    obj1, obj2 = @data.call
+    initial = @specs.get_flags(obj1)
+    @specs.get_flags(obj2).should == initial
+    @specs.set_flags(obj1, 1 << 14 | 1 << 16 | initial)
+    @specs.copy_flags(obj2, obj1)
+    @specs.get_flags(obj2).should == 1 << 14 | 1 << 16 | initial
+    @specs.set_flags(obj1, initial)
+    @specs.copy_flags(obj2, obj1)
+    @specs.get_flags(obj2).should == initial
+  end
 end
diff --git a/spec/ruby/optional/capi/shared/rbasic.rb b/spec/ruby/optional/capi/shared/rbasic.rb
index 659cb07..5ef63e8 100644
--- a/spec/ruby/optional/capi/shared/rbasic.rb
+++ b/spec/ruby/optional/capi/shared/rbasic.rb
@@ -54,26 +54,6 @@ describe :rbasic, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/shared/rbasic.rb#L54
     end
   end
 
-  it "supports user flags" do
-    obj, _ = @data.call
-    initial = @specs.get_flags(obj)
-    @specs.set_flags(obj, 1 << 14 | 1 << 16 | initial).should == 1 << 14 | 1 << 16 | initial
-    @specs.get_flags(obj).should == 1 << 14 | 1 << 16 | initial
-    @specs.set_flags(obj, initial).should == initial
-  end
-
-  it "supports copying the flags from one object over to the other" do
-    obj1, obj2 = @data.call
-    initial = @specs.get_flags(obj1)
-    @specs.get_flags(obj2).should == initial
-    @specs.set_flags(obj1, 1 << 14 | 1 << 16 | initial)
-    @specs.copy_flags(obj2, obj1)
-    @specs.get_flags(obj2).should == 1 << 14 | 1 << 16 | initial
-    @specs.set_flags(obj1, initial)
-    @specs.copy_flags(obj2, obj1)
-    @specs.get_flags(obj2).should == initial
-  end
-
   it "supports retrieving the (meta)class" do
     obj, _ = @data.call
     @specs.get_klass(obj).should == obj.class
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]