mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
FL_USER flags on ohter than T_DATA are reserved [Misc #18059]
This commit is contained in:
parent
845c017e08
commit
225a29b9bc
2 changed files with 20 additions and 20 deletions
spec/ruby/optional/capi
|
@ -20,4 +20,24 @@ describe "RBasic support for RData" do
|
||||||
@data = -> { [@wrapping.wrap_struct(1024), @wrapping.wrap_struct(1025)] }
|
@data = -> { [@wrapping.wrap_struct(1024), @wrapping.wrap_struct(1025)] }
|
||||||
end
|
end
|
||||||
it_should_behave_like :rbasic
|
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
|
end
|
||||||
|
|
|
@ -54,26 +54,6 @@ describe :rbasic, shared: true do
|
||||||
end
|
end
|
||||||
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
|
it "supports retrieving the (meta)class" do
|
||||||
obj, _ = @data.call
|
obj, _ = @data.call
|
||||||
@specs.get_klass(obj).should == obj.class
|
@specs.get_klass(obj).should == obj.class
|
||||||
|
|
Loading…
Add table
Reference in a new issue