Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 14 files changed
  • 0 comments
  • 1 contributor
Mar 05, 2013
remove old tests f929a91
rework iOS static library for better header use
the older direct referencing of headers still works, this is just cooler
e9400e9
39 Examples/PonyExpress iOS Example/PonyExpress iOS Example.xcodeproj/project.pbxproj
@@ -37,13 +37,6 @@
37 37 remoteGlobalIDString = D83E1B741411528100CB1258;
38 38 remoteInfo = "PonyExpress Mac Tests";
39 39 };
40   - D8A1724B16901D28002CFCC8 /* PBXContainerItemProxy */ = {
41   - isa = PBXContainerItemProxy;
42   - containerPortal = D8A1724016901D28002CFCC8 /* PonyExpress.xcodeproj */;
43   - proxyType = 2;
44   - remoteGlobalIDString = D83E1BD71412F87A00CB1258;
45   - remoteInfo = OrphanExample;
46   - };
47 40 D8A1724D16901D28002CFCC8 /* PBXContainerItemProxy */ = {
48 41 isa = PBXContainerItemProxy;
49 42 containerPortal = D8A1724016901D28002CFCC8 /* PonyExpress.xcodeproj */;
@@ -58,6 +51,13 @@
58 51 remoteGlobalIDString = D89B6F00165AFBB400446361;
59 52 remoteInfo = "PonyExpress iOS";
60 53 };
  54 + D8A2992D16E6B6F00067C19C /* PBXContainerItemProxy */ = {
  55 + isa = PBXContainerItemProxy;
  56 + containerPortal = D8A1724016901D28002CFCC8 /* PonyExpress.xcodeproj */;
  57 + proxyType = 2;
  58 + remoteGlobalIDString = D8975A8C168B5D0C0090FEB6;
  59 + remoteInfo = "PonyExpress iOS Tests";
  60 + };
61 61 /* End PBXContainerItemProxy section */
62 62
63 63 /* Begin PBXFileReference section */
@@ -164,9 +164,9 @@
164 164 isa = PBXGroup;
165 165 children = (
166 166 D8A1724816901D28002CFCC8 /* PonyExpress.framework */,
167   - D8A1724A16901D28002CFCC8 /* PonyExpressTests.octest */,
168   - D8A1724C16901D28002CFCC8 /* OrphanExample */,
  167 + D8A1724A16901D28002CFCC8 /* PonyExpress Mac Tests.octest */,
169 168 D8A1724E16901D28002CFCC8 /* libPonyExpress.a */,
  169 + D8A2992E16E6B6F00067C19C /* PonyExpress iOS Tests.octest */,
170 170 );
171 171 name = Products;
172 172 sourceTree = "<group>";
@@ -232,21 +232,13 @@
232 232 remoteRef = D8A1724716901D28002CFCC8 /* PBXContainerItemProxy */;
233 233 sourceTree = BUILT_PRODUCTS_DIR;
234 234 };
235   - D8A1724A16901D28002CFCC8 /* PonyExpressTests.octest */ = {
  235 + D8A1724A16901D28002CFCC8 /* PonyExpress Mac Tests.octest */ = {
236 236 isa = PBXReferenceProxy;
237 237 fileType = wrapper.cfbundle;
238   - name = PonyExpressTests.octest;
239 238 path = "PonyExpress Mac Tests.octest";
240 239 remoteRef = D8A1724916901D28002CFCC8 /* PBXContainerItemProxy */;
241 240 sourceTree = BUILT_PRODUCTS_DIR;
242 241 };
243   - D8A1724C16901D28002CFCC8 /* OrphanExample */ = {
244   - isa = PBXReferenceProxy;
245   - fileType = "compiled.mach-o.executable";
246   - path = OrphanExample;
247   - remoteRef = D8A1724B16901D28002CFCC8 /* PBXContainerItemProxy */;
248   - sourceTree = BUILT_PRODUCTS_DIR;
249   - };
250 242 D8A1724E16901D28002CFCC8 /* libPonyExpress.a */ = {
251 243 isa = PBXReferenceProxy;
252 244 fileType = archive.ar;
@@ -254,6 +246,13 @@
254 246 remoteRef = D8A1724D16901D28002CFCC8 /* PBXContainerItemProxy */;
255 247 sourceTree = BUILT_PRODUCTS_DIR;
256 248 };
  249 + D8A2992E16E6B6F00067C19C /* PonyExpress iOS Tests.octest */ = {
  250 + isa = PBXReferenceProxy;
  251 + fileType = wrapper.cfbundle;
  252 + path = "PonyExpress iOS Tests.octest";
  253 + remoteRef = D8A2992D16E6B6F00067C19C /* PBXContainerItemProxy */;
  254 + sourceTree = BUILT_PRODUCTS_DIR;
  255 + };
257 256 /* End PBXReferenceProxy section */
258 257
259 258 /* Begin PBXResourcesBuildPhase section */
@@ -390,7 +389,7 @@
390 389 buildSettings = {
391 390 GCC_PRECOMPILE_PREFIX_HEADER = YES;
392 391 GCC_PREFIX_HEADER = "PonyExpress iOS Example/PonyExpress iOS Example-Prefix.pch";
393   - HEADER_SEARCH_PATHS = ../../PonyExpress;
  392 + HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include";
394 393 INFOPLIST_FILE = "PonyExpress iOS Example/PonyExpress iOS Example-Info.plist";
395 394 PRODUCT_NAME = "$(TARGET_NAME)";
396 395 VALID_ARCHS = "arm6 armv7 armv7s";
@@ -403,7 +402,7 @@
403 402 buildSettings = {
404 403 GCC_PRECOMPILE_PREFIX_HEADER = YES;
405 404 GCC_PREFIX_HEADER = "PonyExpress iOS Example/PonyExpress iOS Example-Prefix.pch";
406   - HEADER_SEARCH_PATHS = ../../PonyExpress;
  405 + HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include";
407 406 INFOPLIST_FILE = "PonyExpress iOS Example/PonyExpress iOS Example-Info.plist";
408 407 PRODUCT_NAME = "$(TARGET_NAME)";
409 408 VALID_ARCHS = "arm6 armv7 armv7s";
4 Examples/PonyExpress iOS Example/PonyExpress iOS Example/ViewController.h
@@ -3,11 +3,11 @@
3 3 // PonyExpress iOS Example
4 4 //
5 5 // Created by Jean-Pierre Mouilleseaux on 29 Dec 2012.
6   -// Copyright (c) 2012 Chorded Constructions. All rights reserved.
  6 +// Copyright (c) 2013 Chorded Constructions. All rights reserved.
7 7 //
8 8
9 9 #import <UIKit/UIKit.h>
10   -#import "PonyExpress.h"
  10 +#import <PonyExpress/PonyExpress.h>
11 11
12 12 @interface ViewController : UIViewController <PEOSCReceiverDelegate>
13 13 @property (nonatomic, strong) PEOSCReceiver* receiver;
35 PonyExpress.xcodeproj/project.pbxproj
@@ -37,6 +37,12 @@
37 37 D89FA2B816D74E68005C8187 /* PEOSCSenderSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D89FA2B616D74E68005C8187 /* PEOSCSenderSpec.m */; };
38 38 D89FA2BA16D74EC7005C8187 /* PEOSCReceiverSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D89FA2B916D74EC7005C8187 /* PEOSCReceiverSpec.m */; };
39 39 D89FA2BB16D74EC7005C8187 /* PEOSCReceiverSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = D89FA2B916D74EC7005C8187 /* PEOSCReceiverSpec.m */; };
  40 + D8A2995916E6BFD20067C19C /* PonyExpress.h in Headers */ = {isa = PBXBuildFile; fileRef = D83E1B6C1411528100CB1258 /* PonyExpress.h */; settings = {ATTRIBUTES = (Public, ); }; };
  41 + D8A2995A16E6BFD20067C19C /* PEOSCMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D83E1B9F14119A2C00CB1258 /* PEOSCMessage.h */; settings = {ATTRIBUTES = (Public, ); }; };
  42 + D8A2995B16E6BFD20067C19C /* PEOSCSender.h in Headers */ = {isa = PBXBuildFile; fileRef = D83E1B96141190B000CB1258 /* PEOSCSender.h */; settings = {ATTRIBUTES = (Public, ); }; };
  43 + D8A2995C16E6BFD20067C19C /* PEOSCReceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C53D351436795700C8CF3E /* PEOSCReceiver.h */; settings = {ATTRIBUTES = (Public, ); }; };
  44 + D8A2995D16E6BFD70067C19C /* PEOSCMessage-Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D83E1BAE1411A41400CB1258 /* PEOSCMessage-Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
  45 + D8A2995E16E6BFDC0067C19C /* PonyExpress-Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = D87C17FF1413FCA7005A08F3 /* PonyExpress-Internal.h */; };
40 46 D8AF167B14B78C060002A885 /* GCDAsyncUdpSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = D8AF167914B78C060002A885 /* GCDAsyncUdpSocket.h */; };
41 47 D8AF167C14B78C060002A885 /* GCDAsyncUdpSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D8AF167A14B78C060002A885 /* GCDAsyncUdpSocket.m */; };
42 48 D8C53D371436795700C8CF3E /* PEOSCReceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C53D351436795700C8CF3E /* PEOSCReceiver.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -144,18 +150,6 @@
144 150 };
145 151 /* End PBXContainerItemProxy section */
146 152
147   -/* Begin PBXCopyFilesBuildPhase section */
148   - D89B6EFF165AFBB400446361 /* CopyFiles */ = {
149   - isa = PBXCopyFilesBuildPhase;
150   - buildActionMask = 2147483647;
151   - dstPath = "include/${PRODUCT_NAME}";
152   - dstSubfolderSpec = 16;
153   - files = (
154   - );
155   - runOnlyForDeploymentPostprocessing = 0;
156   - };
157   -/* End PBXCopyFilesBuildPhase section */
158   -
159 153 /* Begin PBXFileReference section */
160 154 D83E1B5C1411528100CB1258 /* PonyExpress.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PonyExpress.framework; sourceTree = BUILT_PRODUCTS_DIR; };
161 155 D83E1B641411528100CB1258 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -403,6 +397,19 @@
403 397 );
404 398 runOnlyForDeploymentPostprocessing = 0;
405 399 };
  400 + D8A2995816E6BFC60067C19C /* Headers */ = {
  401 + isa = PBXHeadersBuildPhase;
  402 + buildActionMask = 2147483647;
  403 + files = (
  404 + D8A2995916E6BFD20067C19C /* PonyExpress.h in Headers */,
  405 + D8A2995A16E6BFD20067C19C /* PEOSCMessage.h in Headers */,
  406 + D8A2995B16E6BFD20067C19C /* PEOSCSender.h in Headers */,
  407 + D8A2995C16E6BFD20067C19C /* PEOSCReceiver.h in Headers */,
  408 + D8A2995D16E6BFD70067C19C /* PEOSCMessage-Private.h in Headers */,
  409 + D8A2995E16E6BFDC0067C19C /* PonyExpress-Internal.h in Headers */,
  410 + );
  411 + runOnlyForDeploymentPostprocessing = 0;
  412 + };
406 413 /* End PBXHeadersBuildPhase section */
407 414
408 415 /* Begin PBXNativeTarget section */
@@ -473,7 +480,7 @@
473 480 buildPhases = (
474 481 D89B6EFD165AFBB400446361 /* Sources */,
475 482 D89B6EFE165AFBB400446361 /* Frameworks */,
476   - D89B6EFF165AFBB400446361 /* CopyFiles */,
  483 + D8A2995816E6BFC60067C19C /* Headers */,
477 484 );
478 485 buildRules = (
479 486 );
@@ -954,6 +961,7 @@
954 961 );
955 962 OTHER_LDFLAGS = "-ObjC";
956 963 PRODUCT_NAME = PonyExpress;
  964 + PUBLIC_HEADERS_FOLDER_PATH = include/PonyExpress;
957 965 SDKROOT = iphoneos;
958 966 SKIP_INSTALL = YES;
959 967 TARGETED_DEVICE_FAMILY = "1,2";
@@ -970,6 +978,7 @@
970 978 GCC_PREFIX_HEADER = "PonyExpress/PonyExpress-Prefix.pch";
971 979 OTHER_LDFLAGS = "-ObjC";
972 980 PRODUCT_NAME = PonyExpress;
  981 + PUBLIC_HEADERS_FOLDER_PATH = include/PonyExpress;
973 982 SDKROOT = iphoneos;
974 983 SKIP_INSTALL = YES;
975 984 TARGETED_DEVICE_FAMILY = "1,2";
13 PonyExpressTests-OLD/PonyEpressReceiverTests.h
... ... @@ -1,13 +0,0 @@
1   -//
2   -// PonyEpressReceiverTests.h
3   -// PonyExpress
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 30 Sept 2011.
6   -// Copyright (c) 2011 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import <SenTestingKit/SenTestingKit.h>
10   -#import <OCMock/OCMock.h>
11   -
12   -@interface PonyEpressReceiverTests : SenTestCase
13   -@end
162 PonyExpressTests-OLD/PonyEpressReceiverTests.m
... ... @@ -1,162 +0,0 @@
1   -//
2   -// PonyEpressReceiverTests.m
3   -// PonyExpress
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 30 Sept 2011.
6   -// Copyright (c) 2011-2012 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import "PonyEpressReceiverTests.h"
10   -#import "PonyExpressTestHelper.h"
11   -#import "PEOSCReceiver.h"
12   -
13   -@interface PonyEpressReceiverTests()
14   -@property (nonatomic) UInt16 unprivledgedPort;
15   -@property (nonatomic) UInt16 privledgedPort;
16   -@end
17   -
18   -@implementation PonyEpressReceiverTests
19   -
20   -- (void)setUp {
21   - [super setUp];
22   -
23   - self.privledgedPort = 80;
24   - self.unprivledgedPort = 31337;
25   -}
26   -
27   -- (void)tearDown {
28   - // TODO - receivers should stop listening?
29   -
30   - [super tearDown];
31   -}
32   -
33   -#pragma mark -
34   -
35   -- (void)testCreation {
36   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
37   - STAssertNotNil(receiver, @"should provide class initializer");
38   -
39   - receiver = [[PEOSCReceiver alloc] initWithPort:self.unprivledgedPort];
40   - STAssertNotNil(receiver, @"should provide alloc/init initializer");
41   -}
42   -
43   -- (void)testPortAssignment {
44   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
45   - STAssertEquals(self.unprivledgedPort, receiver.port, @"should store port");
46   -}
47   -
48   -- (void)testDelegateAssignment {
49   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
50   - id mockDelegate = [OCMockObject mockForProtocol:@protocol(PEOSCReceiverDelegate)];
51   - receiver.delegate = mockDelegate;
52   - STAssertEqualObjects(mockDelegate, receiver.delegate, @"should assign proper delegate");
53   -}
54   -
55   -#pragma mark - LISTEN
56   -
57   -- (void)testListeningFlowOnAPrivledgedPort {
58   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.privledgedPort];
59   - NSError* error;
60   - BOOL status = [receiver beginListening:&error];
61   - STAssertFalse(status, @"should report unsuccessful begin listening");
62   - STAssertNotNil(error, @"should provide error");
63   - STAssertFalse(receiver.isListening, @"should report as not listening");
64   -
65   - __block BOOL done = NO;
66   - [receiver stopListeningWithCompletionHandler:^(BOOL success, NSError* error) {
67   - STAssertFalse(success, @"should report unsuccessful stop listening");
68   - STAssertNotNil(error, @"should provide error");
69   - STAssertFalse(receiver.isListening, @"should report as not listening");
70   -
71   - done = YES;
72   - }];
73   -
74   - STAssertTrue(WaitFor(^BOOL { return done; }), @"async stop listening failed");
75   -}
76   -
77   -- (void)testListeningFlowOnAnUnprivledgedPort {
78   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
79   - NSError* error;
80   - BOOL status = [receiver beginListening:&error];
81   - STAssertTrue(status, @"should report successful begin listening");
82   - STAssertNil(error, @"should not provide error");
83   - STAssertTrue(receiver.isListening, @"should report as listening");
84   -
85   - __block BOOL done = NO;
86   - [receiver stopListeningWithCompletionHandler:^(BOOL success, NSError* error) {
87   - STAssertTrue(success, @"should report successful stop listening");
88   - STAssertNil(error, @"should not provide error");
89   - STAssertFalse(receiver.isListening, @"should report as not listening");
90   -
91   - done = YES;
92   - }];
93   -
94   - STAssertTrue(WaitFor(^BOOL { return done; }), @"async stop listening failed");
95   -}
96   -
97   -// KNOWN FAILURE - test doesn't make sense, socket option SO_REUSEPORT enabled, this will NOT fail
98   -- (void)testListenFlowOnAPortInUse {
99   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
100   - __block NSError* error;
101   - __block BOOL status = [receiver beginListening:&error];
102   - STAssertTrue(status, @"should report successful begin listening");
103   - STAssertNil(error, @"should not provide error");
104   - STAssertTrue(receiver.isListening, @"should report as listening");
105   -
106   - // attempt to connect second
107   - PEOSCReceiver* otherReceiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
108   - status = [otherReceiver beginListening:&error];
109   - STAssertFalse(status, @"should report unsuccessful begin listening");
110   - STAssertNotNil(error, @"should provide error");
111   - STAssertFalse(otherReceiver.isListening, @"should report as not listening");
112   -
113   - // disconnect first
114   - __block BOOL done = NO;
115   - [receiver stopListeningWithCompletionHandler:^(BOOL success, NSError* stopError) {
116   - STAssertTrue(success, @"should report successful stop listening");
117   - STAssertNil(stopError, @"should not provide error");
118   - STAssertFalse(receiver.isListening, @"should report as not listening");
119   -
120   - // re-attempt to connect second
121   - status = [otherReceiver beginListening:&error];
122   - STAssertTrue(status, @"should report successful begin listening");
123   - STAssertNil(error, @"should not provide error");
124   - STAssertTrue(otherReceiver.isListening, @"should report as listening");
125   -
126   - done = YES;
127   - }];
128   -
129   - STAssertTrue(WaitFor(^BOOL { return done; }), @"async stop listening failed");
130   -}
131   -
132   -- (void)testListeningWhileListening {
133   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
134   - NSError* error;
135   - BOOL status = [receiver beginListening:&error];
136   - STAssertTrue(status, @"should report successful begin listening");
137   - STAssertNil(error, @"should not provide error");
138   - STAssertTrue(receiver.isListening, @"should report as listening");
139   -
140   - status = [receiver beginListening:&error];
141   - STAssertFalse(status, @"should report unsuccessful begin listening");
142   - STAssertNotNil(error, @"should provide an error");
143   - STAssertEquals(error.code, PEOSCReceiverAlreadyListeningError, @"should provide already listening error");
144   - STAssertTrue(receiver.isListening, @"should report as listening");
145   -}
146   -
147   -- (void)testStopListeningWhileNotListening {
148   - __block BOOL done = NO;
149   - PEOSCReceiver* receiver = [PEOSCReceiver receiverWithPort:self.unprivledgedPort];
150   - [receiver stopListeningWithCompletionHandler:^(BOOL success, NSError* error) {
151   - STAssertFalse(success, @"should report unsuccessful stop listening");
152   - STAssertNotNil(error, @"should provide error");
153   - STAssertEquals(error.code, PEOSCReceiverNotListeningError, @"should provide not listening error");
154   - STAssertFalse(receiver.isListening, @"should report as not listening");
155   -
156   - done = YES;
157   - }];
158   -
159   - STAssertTrue(WaitFor(^BOOL { return done; }), @"async stop listening failed");
160   -}
161   -
162   -@end
12 PonyExpressTests-OLD/PonyExpressMessageTests.h
... ... @@ -1,12 +0,0 @@
1   -//
2   -// PonyExpressMessageTests.h
3   -// PonyExpress
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 7 Sept 2011.
6   -// Copyright (c) 2011 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import <SenTestingKit/SenTestingKit.h>
10   -
11   -@interface PonyExpressMessageTests : SenTestCase
12   -@end
232 PonyExpressTests-OLD/PonyExpressMessageTests.m
... ... @@ -1,232 +0,0 @@
1   -//
2   -// PonyExpressMessageTests.m
3   -// PonyExpress
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 7 Sept 2011.
6   -// Copyright (c) 2011 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import "PonyExpressMessageTests.h"
10   -#import "PEOSCMessage.h"
11   -#import "PEOSCMessage-Private.h"
12   -
13   -@interface PonyExpressMessageTests()
14   -@property (nonatomic, strong) NSArray* allTypes;
15   -@property (nonatomic, strong) NSArray* allArgs;
16   -@property (nonatomic, strong) NSString* goodAddress;
17   -@property (nonatomic, strong) NSString* badAddress;
18   -@end
19   -
20   -@implementation PonyExpressMessageTests
21   -
22   -- (void)setUp {
23   - [super setUp];
24   -
25   - NSData* stringData = [@"One-Eyed Jacks" dataUsingEncoding:NSASCIIStringEncoding];
26   - NSDate* now = [NSDate date];
27   -
28   - self.allTypes = @[PEOSCMessageTypeTagInteger, PEOSCMessageTypeTagFloat, PEOSCMessageTypeTagString, PEOSCMessageTypeTagBlob, PEOSCMessageTypeTagTrue, PEOSCMessageTypeTagFalse, PEOSCMessageTypeTagNull, PEOSCMessageTypeTagImpulse, PEOSCMessageTypeTagTimetag];
29   - self.allArgs = @[@13, @33.3F, @"STRING", stringData, now];
30   -
31   - self.goodAddress = @"/oscillator/3/frequency";
32   - self.badAddress = @"bad/address";
33   -}
34   -
35   -- (void)tearDown {
36   - // Tear-down code here.
37   -
38   - [super tearDown];
39   -}
40   -
41   -#pragma mark - CREATION
42   -
43   -- (void)testClassMethodCreation {
44   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
45   - STAssertNotNil(message, @"should provide a message instance");
46   -}
47   -
48   -- (void)testInstanceMethodCreation {
49   - PEOSCMessage* message = [[PEOSCMessage alloc] initWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
50   - STAssertNotNil(message, @"should provide a message instance");
51   -}
52   -
53   -- (void)testCreationArguments {
54   - NSArray* typeTags = @[PEOSCMessageTypeTagInteger];
55   - NSArray* arguments = @[@440];
56   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:typeTags arguments:arguments];
57   - STAssertEqualObjects(self.goodAddress, message.address, @"should store proper address");
58   - STAssertEqualObjects(typeTags, message.typeTags, @"should store proper type tags");
59   - STAssertEqualObjects(arguments, message.arguments, @"should store proper arguments");
60   -}
61   -
62   -// KNOWN FAILURE - the NSDate/Timetag serialziation isn't perfectly symmetrical
63   -- (void)testCreationFromData {
64   - PEOSCMessage* m = [[PEOSCMessage alloc] initWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
65   - // NB - this presumes good data serialization
66   - NSData* data = [m _data];
67   -
68   - PEOSCMessage* message = [PEOSCMessage messageWithData:data];
69   - STAssertNotNil(message, @"should create message from valid data");
70   - STAssertEqualObjects(m.address, message.address, @"should restore address");
71   - STAssertEqualObjects(m.typeTags, message.typeTags, @"should restore type tags");
72   - STAssertEqualObjects(m.arguments, message.arguments, @"should restore arguments");
73   -}
74   -
75   -- (void)testCreationFromBadData {
76   - PEOSCMessage* message = [PEOSCMessage messageWithData:[@"Nonsensical" dataUsingEncoding:NSASCIIStringEncoding]];
77   - STAssertNil(message, @"should not create message from invalid data");
78   -}
79   -
80   -#pragma mark - ADDRESS
81   -
82   -- (void)testAddressValidity {
83   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:nil arguments:nil];
84   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
85   -
86   - message.address = @"/?/b/*c";
87   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
88   -
89   - message.address = @"/oscillator/*/frequency";
90   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
91   -
92   - message.address = @"/oscillator/[1-4]/frequency";
93   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
94   -
95   - message.address = @"/oscillator/[1234]/frequency";
96   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
97   -
98   - message.address = @"/oscillator/[!5-6]/frequency";
99   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
100   -
101   - message.address = @"/oscillator/[!56]/frequency";
102   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
103   -
104   - message.address = @"/oscillator/3/frequency!";
105   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
106   -
107   - message.address = @"/oscillator/{1,3,5,7}/frequency";
108   - STAssertTrue([message _isAddressValid], @"should consider legit address valid");
109   -
110   -
111   - message.address = @"oscillator/666";
112   - STAssertFalse([message _isAddressValid], @"should require address to begin with backslash");
113   -
114   - message.address = @"/super oscillator/666";
115   - STAssertFalse([message _isAddressValid], @"should disallow spaces");
116   -
117   - message.address = @"/oscillator/3,9/frequency";
118   - STAssertFalse([message _isAddressValid], @"should disallow comma when not in curly brace list");
119   -
120   - message.address = @"/oscillator/op-1/frequency";
121   - STAssertFalse([message _isAddressValid], @"should disallow dash when not in bracket range");
122   -
123   - message.address = @"/oscillator/{3-9}/frequency";
124   - STAssertFalse([message _isAddressValid], @"should not allow dash within curly brace list");
125   -
126   - message.address = @"/oscillator/{3,9/frequency";
127   - STAssertFalse([message _isAddressValid], @"should require closing curly brace in list");
128   -
129   - message.address = @"/oscillator/[3,9]/frequency";
130   - STAssertFalse([message _isAddressValid], @"should not allow comma in square bracket range");
131   -
132   - message.address = @"/oscillator/[3-9/frequency";
133   - STAssertFalse([message _isAddressValid], @"should require closing square bracket in range");
134   -
135   - message.address = @"/oscillator/{[3-9],13}/frequency";
136   - STAssertFalse([message _isAddressValid], @"should not allow nested range within list");
137   -
138   - message.address = @"/oscillator/{{3,4},13}/frequency";
139   - STAssertFalse([message _isAddressValid], @"should not allow nested lists");
140   -
141   - message.address = @"/oscillator/[[3-4]-13]/frequency";
142   - STAssertFalse([message _isAddressValid], @"should not allow nested ranges");
143   -}
144   -
145   -#pragma mark - TYPES
146   -
147   -- (void)testTypeTagString {
148   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
149   - STAssertEqualObjects(@",ifsbTFNIt", [message _typeTagString], @"should generate proper type tag string");
150   - STAssertTrue([message _areTypeTagsValid], @"should report string from legit type tag list as valid");
151   -
152   - message.typeTags = @[];
153   - STAssertEqualObjects([message _typeTagString], @",", @"should generate tag-less type tag string");
154   - STAssertTrue([message _areTypeTagsValid], @"should report string from empty type tag list as valid");
155   -
156   - message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:nil arguments:nil];
157   - STAssertEqualObjects([message _typeTagString], @",", @"should generate tag-less type tag string");
158   - STAssertTrue([message _areTypeTagsValid], @"should report string from empty type tag list as valid");
159   -
160   - message.typeTags = @[PEOSCMessageTypeTagImpulse, @13];
161   - STAssertNil([message _typeTagString], @"should not generate a type tag string when the list contains a bad element");
162   - STAssertFalse([message _areTypeTagsValid], @"should report string from bad type tag list as invalid");
163   -}
164   -
165   -#pragma mark - ARGUMENTS
166   -
167   -- (void)testArgumentsRequirements {
168   - STAssertTrue([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagInteger], @"should report the Integer type as requiring an argument ");
169   - STAssertTrue([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagFloat], @"should report the Float type as requiring an argument ");
170   - STAssertTrue([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagString], @"should report the String type as requiring an argument ");
171   - STAssertTrue([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagBlob], @"should report the Blob type as requiring an argument ");
172   - STAssertFalse([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagTrue], @"should report the True type as requiring an argument ");
173   - STAssertFalse([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagFalse], @"should report the False type as requiring an argument ");
174   - STAssertFalse([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagNull], @"should report the Null type as requiring an argument ");
175   - STAssertFalse([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagImpulse], @"should report the Impulse type as requiring an argument ");
176   - STAssertTrue([PEOSCMessage argumentRequiredByType:PEOSCMessageTypeTagTimetag], @"should report the Timetag type as requiring an argument ");
177   -}
178   -
179   -- (void)testArgumentValidity {
180   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
181   - STAssertTrue([message _areArgumentsValidGivenTypeTags], @"should treat identify valid arguments as valid");
182   -
183   - message.arguments = nil;
184   - STAssertFalse([message _areArgumentsValidGivenTypeTags], @"should treat identify nil arguments as invalid for valid types");
185   -
186   - message.arguments = @[];
187   - STAssertFalse([message _areArgumentsValidGivenTypeTags], @"should treat identify enmpty arguments as invalid for valid types");
188   -
189   - message.typeTags = @[PEOSCMessageTypeTagImpulse];
190   - message.arguments = self.allArgs;
191   - STAssertFalse([message _areArgumentsValidGivenTypeTags], @"should treat identify mismatching arguments to type tags as invalid");
192   -}
193   -
194   -- (void)testDataEnumerator {
195   - PEOSCMessage* message = [PEOSCMessage messageWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
196   - [message enumerateTypesAndArgumentsUsingBlock:^(id type, id argument, BOOL* stop) {
197   - if ([PEOSCMessage argumentRequiredByType:type])
198   - STAssertNotNil(argument, @"should provide argument for type %@", type);
199   - else
200   - STAssertNil(argument, @"should NOT provide argument for type %@", type);
201   - }];
202   -
203   - __block NSUInteger iterations = 0;
204   - [message enumerateTypesAndArgumentsUsingBlock:^(id type, id argument, BOOL* stop) {
205   - if ([type isEqualToString:PEOSCMessageTypeTagTrue])
206   - *stop = YES;
207   - iterations++;
208   - }];
209   - STAssertTrue(iterations == 5, @"should allow enumeration to be stopped");
210   -}
211   -
212   -#pragma mark - DATA
213   -
214   -- (void)testGoodMessageGeneration {
215   - PEOSCMessage* message = [[PEOSCMessage alloc] initWithAddress:self.goodAddress typeTags:self.allTypes arguments:self.allArgs];
216   - NSData* data = [message _data];
217   - STAssertNotNil(data, @"should generate valid data");
218   - // TODO - compare to expected length?
219   -}
220   -
221   -- (void)testBadMessageGeneration {
222   - PEOSCMessage* message = [[PEOSCMessage alloc] initWithAddress:self.badAddress typeTags:self.allTypes arguments:self.allArgs];
223   - STAssertNil([message _data], @"should not generate data for message with bad address");
224   -
225   - message = [[PEOSCMessage alloc] initWithAddress:self.goodAddress typeTags:@[@"Nonsensical"] arguments:self.allArgs];
226   - STAssertNil([message _data], @"should not generate data for message with bad types");
227   -
228   - message = [[PEOSCMessage alloc] initWithAddress:self.goodAddress typeTags:self.allTypes arguments:@[@"Nonsensical"]];
229   - STAssertNil([message _data], @"should not generate data for message with bad arguments");
230   -}
231   -
232   -@end
14 PonyExpressTests-OLD/PonyExpressSenderTests.h
... ... @@ -1,14 +0,0 @@
1   -//
2   -// PonyExpressSenderTests.h
3   -// PonyExpressSenderTests
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 2 Sept 2011.
6   -// Copyright (c) 2011-2012 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import <Foundation/Foundation.h>
10   -#import <SenTestingKit/SenTestingKit.h>
11   -#import <OCMock/OCMock.h>
12   -
13   -@interface PonyExpressSenderTests : SenTestCase
14   -@end
55 PonyExpressTests-OLD/PonyExpressSenderTests.m
... ... @@ -1,55 +0,0 @@
1   -//
2   -// PonyExpressSenderTests.m
3   -// PonyExpressSenderTests
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 2 Sept 2011.
6   -// Copyright (c) 2011-2012 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -#import "PonyExpressSenderTests.h"
10   -#import "PEOSCMessage.h"
11   -#import "PEOSCMessage-Private.h"
12   -#import "PEOSCSender.h"
13   -
14   -@interface PonyExpressSenderTests()
15   -@property (nonatomic, strong) NSString* loopbackHost;
16   -@property (nonatomic) UInt16 unprivledgedPort;
17   -@property (nonatomic) UInt16 privledgedPort;
18   -@end
19   -
20   -@implementation PonyExpressSenderTests
21   -
22   -- (void)setUp {
23   - [super setUp];
24   -
25   - self.loopbackHost = @"127.0.0.1";
26   -
27   - self.privledgedPort = 80;
28   - self.unprivledgedPort = 31337;
29   -}
30   -
31   -- (void)tearDown {
32   - // TODO - senders should disconnect?
33   -
34   - [super tearDown];
35   -}
36   -
37   -#pragma mark -
38   -
39   -- (void)testCreation {
40   - PEOSCSender* sender = [PEOSCSender senderWithHost:self.loopbackHost port:self.unprivledgedPort];
41   - STAssertNotNil(sender, @"should provide instance from class initializer");
42   -
43   - sender = [[PEOSCSender alloc] initWithHost:self.loopbackHost port:self.unprivledgedPort];
44   - STAssertNotNil(sender, @"should provide instance from default initializer");
45   -}
46   -
47   -- (void)testHostAndPortAssignment {
48   - PEOSCSender* sender = [PEOSCSender senderWithHost:self.loopbackHost port:self.unprivledgedPort];
49   - STAssertEqualObjects(self.loopbackHost, sender.host, @"should store proper host");
50   - STAssertEquals(self.unprivledgedPort, sender.port, @"should store port");
51   -}
52   -
53   -// TODO - sending
54   -
55   -@end
16 PonyExpressTests-OLD/PonyExpressTestHelper.h
... ... @@ -1,16 +0,0 @@
1   -//
2   -// PonyExpressTestHelper.h
3   -// PonyExpress
4   -//
5   -// Created by Jean-Pierre Mouilleseaux on 21 Apr 2012.
6   -// Copyright (c) 2012 Chorded Constructions. All rights reserved.
7   -//
8   -
9   -// via http://mikeash.com/pyblog/friday-qa-2011-07-22-writing-unit-tests.html
10   -static BOOL WaitFor(BOOL (^block)(void));
11   -static BOOL WaitFor(BOOL (^block)(void)) {
12   - NSTimeInterval start = [[NSProcessInfo processInfo] systemUptime];
13   - while(!block() && [[NSProcessInfo processInfo] systemUptime] - start <= 10)
14   - [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode beforeDate: [NSDate date]];
15   - return block();
16   -}
22 PonyExpressTests-OLD/PonyExpressTests-Info.plist
... ... @@ -1,22 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3   -<plist version="1.0">
4   -<dict>
5   - <key>CFBundleDevelopmentRegion</key>
6   - <string>en</string>
7   - <key>CFBundleExecutable</key>
8   - <string>${EXECUTABLE_NAME}</string>
9   - <key>CFBundleIdentifier</key>
10   - <string>com.chordedconstructions.fleshworld.${PRODUCT_NAME:rfc1034identifier}</string>
11   - <key>CFBundleInfoDictionaryVersion</key>
12   - <string>6.0</string>
13   - <key>CFBundlePackageType</key>
14   - <string>BNDL</string>
15   - <key>CFBundleShortVersionString</key>
16   - <string>1.0</string>
17   - <key>CFBundleSignature</key>
18   - <string>????</string>
19   - <key>CFBundleVersion</key>
20   - <string>1</string>
21   -</dict>
22   -</plist>
2  PonyExpressTests-OLD/en.lproj/InfoPlist.strings
... ... @@ -1,2 +0,0 @@
1   -/* Localized versions of Info.plist keys */
2   -
6 PonyExpressTests/PonyExpressTests-Prefix.pch
@@ -5,11 +5,7 @@
5 5 #ifdef __OBJC__
6 6 #import <Foundation/Foundation.h>
7 7
8   - #if TARGET_OS_IPHONE
9   - #import "PonyExpress.h"
10   - #else
11   - #import <PonyExpress/PonyExpress.h>
12   - #endif
  8 + #import <PonyExpress/PonyExpress.h>
13 9
14 10 #import "Specta.h"
15 11
3  TODO.md
Source Rendered
... ... @@ -1,13 +1,12 @@
1 1
2 2 ### GENERAL
3 3 - pull address validation code out to a class method and use within -[PEOSCMessage initWithData:]
4   -- redo static library for iOS in the mannor [descirbed by jamie](http://www.blog.montgomerie.net/easy-xcode-static-library-subprojects-and-submodules) and migrate Example/Tests to it
5 4 - go unicast and later add multicast support
6 5 - sort out OSC bundle support
7 6 - test interoperability against Lemur, TouchOSC, Max 6, oF and Cinder
8 7 - figure out how to expose a constant for the 'immediate' NTPTimetag (NSDate category? only relevant for bundles invocation?)
9 8 - look into simple MIDI tunneling example
10   -- add more in-depth usage info to [README](README.md) for Mac OS X and iOS applications (@rpath!)
  9 +- add more in-depth usage info to [README](README.md) for Mac OS X and iOS applications (@rpath and [iOS usage](http://www.blog.montgomerie.net/easy-xcode-static-library-subprojects-and-submodules))
11 10 - remove +[PEOSCMessage displayNameForType:]
12 11 - add CONTRIBUTING.md
13 12

No commit comments for this range

Something went wrong with that request. Please try again.