зеркало из https://github.com/github/ruby.git
FL_USER flags on ohter than T_DATA are reserved [Misc #18059]
This commit is contained in:
Родитель
845c017e08
Коммит
225a29b9bc
|
@ -20,4 +20,24 @@ describe "RBasic support for RData" do
|
|||
@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
|
||||
|
|
|
@ -54,26 +54,6 @@ describe :rbasic, shared: true do
|
|||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче