mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-01 17:39:54 +08:00
add test for RM-358
This commit is contained in:
@@ -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
|
||||
|
||||
6
test/test/vendor/code/code.h
vendored
6
test/test/vendor/code/code.h
vendored
@@ -1,4 +1,8 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
struct MyStructHasName {
|
||||
id name;
|
||||
};
|
||||
|
||||
struct MyStructTestConvert {
|
||||
long m_long;
|
||||
|
||||
Reference in New Issue
Block a user