diff --git a/test/test/spec/memory_spec.rb b/test/test/spec/memory_spec.rb index e1bf6225..d269624e 100644 --- a/test/test/spec/memory_spec.rb +++ b/test/test/spec/memory_spec.rb @@ -591,6 +591,35 @@ describe "Struct" do end end +describe "Boxed" do + class TestBoxed + def initialize + @member = MyStructHasName.new + @member.name = "foo" + end + + def test_boxed_setter + name = @member.name + @member.name = "foo" + + name.inspect + end + end + + # RM-358 + it "setter method should not released the object" do + @foo = TestBoxed.new + + 5.times do + @foo.performSelectorOnMainThread(:'test_boxed_setter', withObject:nil, waitUntilDone:false) + NSRunLoop.currentRunLoop.runUntilDate(NSDate.dateWithTimeIntervalSinceNow(0.2)) + end + + # test_boxed_setter should not cause a crash + 1.should == 1 + end +end + # RM-290 describe "NSMutableData" do class NSMutableData diff --git a/test/test/vendor/code/code.h b/test/test/vendor/code/code.h index edb4c9de..03a1959c 100644 --- a/test/test/vendor/code/code.h +++ b/test/test/vendor/code/code.h @@ -1,4 +1,8 @@ -#import + #import + +struct MyStructHasName { + id name; +}; struct MyStructTestConvert { long m_long;