add test for RM-358

This commit is contained in:
Watson
2013-12-16 10:03:42 +09:00
parent 897f1d003c
commit 5155480c2d
2 changed files with 34 additions and 1 deletions

View File

@@ -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

View File

@@ -1,4 +1,8 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
struct MyStructHasName {
id name;
};
struct MyStructTestConvert {
long m_long;