From 0d29a453bc18eb9490f46817ddf53bb13624dcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Mon, 17 Mar 2014 17:13:46 +0100 Subject: [PATCH] [test] Get source to build on OS X 10.7 32-bit. --- test/test/Rakefile | 18 ++++++++++++++++-- test/test/vendor/code/subscripting.h | 7 +++++-- test/test/vendor/code/subscripting.m | 13 ++++++++----- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/test/test/Rakefile b/test/test/Rakefile index 28be5a51..013422a1 100644 --- a/test/test/Rakefile +++ b/test/test/Rakefile @@ -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 diff --git a/test/test/vendor/code/subscripting.h b/test/test/vendor/code/subscripting.h index 59755602..071f8eb1 100644 --- a/test/test/vendor/code/subscripting.h +++ b/test/test/vendor/code/subscripting.h @@ -1,6 +1,9 @@ #import -@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)key; -@end \ No newline at end of file +@end diff --git a/test/test/vendor/code/subscripting.m b/test/test/vendor/code/subscripting.m index 77d2ee15..c7059998 100644 --- a/test/test/vendor/code/subscripting.m +++ b/test/test/vendor/code/subscripting.m @@ -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)key; { - self.dictionary[key] = object; + [self.dictionary setObject:object forKey:key]; } -@end \ No newline at end of file +@end