[test] Get source to build on OS X 10.7 32-bit.

This commit is contained in:
Eloy Durán
2014-03-17 17:13:46 +01:00
parent f024795ed0
commit 0d29a453bc
3 changed files with 29 additions and 9 deletions

View File

@@ -1,7 +1,6 @@
$:.unshift("../../lib")
platform = ENV['PLATFORM'] || 'ios'
require "motion/project/template/#{platform}"
require "motion/project/template/#{ENV['PLATFORM'] || 'ios'}"
ENV['output'] ||= 'pretty_spec_dox'
@@ -15,6 +14,21 @@ Motion::Project::App.setup do |app|
app.deployment_target = ENV['deployment_target'] if ENV['deployment_target']
app.archs[app.local_platform] = [ENV['ARCH']] if ENV['ARCH']
# 10.8 and 10.9 are 64-bit only.
if ENV['PLATFORM'] == 'osx' && ENV['ARCH'] == 'i386'
app.deployment_target = '10.7'
end
end
task :clean do
if ENV['ARCH']
dir = "./vendor/code/build-#{ENV['ARCH']}"
if File.exist?(dir)
App.info 'Delete', dir
FileUtils.rm_rf dir
end
end
end
namespace :spec do

View File

@@ -1,6 +1,9 @@
#import <Foundation/Foundation.h>
@interface TestSubscripting : NSObject
@interface TestSubscripting : NSObject {
NSMutableArray *_array;
NSMutableDictionary *_dictionary;
}
- (id)objectAtIndexedSubscript:(NSUInteger)index;
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
@@ -8,4 +11,4 @@
- (id)objectForKeyedSubscript:(id)key;
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;
@end
@end

View File

@@ -7,6 +7,9 @@
@implementation TestSubscripting
@synthesize array = _array;
@synthesize dictionary = _dictionary;
- (instancetype)init;
{
if ((self = [super init])) {
@@ -18,22 +21,22 @@
- (id)objectAtIndexedSubscript:(NSUInteger)index;
{
return self.array[index];
return [self.array objectAtIndex:index];
}
- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
{
self.array[index] = object;
[self.array replaceObjectAtIndex:index withObject:object];
}
- (id)objectForKeyedSubscript:(id)key;
{
return self.dictionary[key];
return [self.dictionary objectForKey:key];
}
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key;
{
self.dictionary[key] = object;
[self.dictionary setObject:object forKey:key];
}
@end
@end