+++ /dev/null
-//
-// NSMethodSignature+WOTest.h
-// WOTest
-//
-// Created by Wincent Colaiuta on 30 January 2006.
-//
-// Copyright 2006-2007 Wincent Colaiuta.
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface NSMethodSignature (WOTest)
-
-+ (id)WOTest_signatureBasedOnObjCTypes:(const char *)types;
-
-@end
+++ /dev/null
-//
-// NSMethodSignature+WOTest.m
-// WOTest
-//
-// Created by Wincent Colaiuta on 30 January 2006.
-//
-// Copyright 2006-2007 Wincent Colaiuta.
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "NSMethodSignature+WOTest.h"
-#import <objc/objc-class.h>
-
-/*
-
- The real 10.4 NSMethodSignature API (obtained using class-dump; TODO: run class-dump to get 10.5 API):
-
-@interface NSMethodSignature : NSObject
-{
- char *_types;
- int _nargs;
- unsigned int _sizeofParams;
- unsigned int _returnValueLength;
- void *_parmInfoP;
- int *_fixup;
- void *_reserved;
-}
-
-+ (id)signatureWithObjCTypes:(const char *)fp8;
-- (BOOL)_isReturnStructInRegisters;
-- (id)retain;
-- (void)release;
-- (unsigned int)retainCount;
-- (const char *)methodReturnType; // PUBLIC
-- (unsigned int)methodReturnLength; // PUBLIC
-- (BOOL)isOneway; // PUBLIC
-- (const char *)getArgumentTypeAtIndex:(unsigned int)fp8; // PUBLIC
-- (struct _arginfo)_argumentInfoAtIndex:(unsigned int)fp8;
-- (unsigned int)frameLength; // PUBLIC
-- (unsigned int)numberOfArguments; // PUBLIC
-- (id)description;
-- (id)debugDescription;
-
-@end
-
-The public API:
-
-@interface NSMethodSignature : NSObject {
- @private
- const char *_types;
- int _nargs;
- unsigned _sizeofParams;
- unsigned _returnValueLength;
- void *_parmInfoP;
- int *_fixup;
- void *_reserved;
-}
-
-- (unsigned)numberOfArguments;
-- (const char *)getArgumentTypeAtIndex:(unsigned)index;
-- (unsigned)frameLength;
-- (BOOL)isOneway;
-- (const char *)methodReturnType;
-- (unsigned)methodReturnLength;
-
-@end
-
-Many public implementations of that use NSProxy subclasses to implement trampolines make use of the signatureWithObjCTypes: private API.
-
-Examples: OCMock
-http://www.cocoadev.com/index.pl?LSTrampoline
-http://www.cocoadev.com/index.pl?BSTrampoline
-
-See also http://www.stuffonfire.com/2005/12/signaturewithobjctypes_is_stil.html
-
- */
-
-@interface NSMethodSignature (WOApplePrivate)
-
-/*! Private Apple API. */
-+ (id)signatureWithObjCTypes:(const char *)fp8;
-
-@end
-
-@interface NSMethodSignature ()
-
-- (id)initWithObjCTypes:(const char *)types;
-
-@end
-
-@implementation NSMethodSignature (WOTest)
-
-+ (id)WOTest_signatureBasedOnObjCTypes:(const char *)types
-{
- NSParameterAssert(types != NULL);
-
-#ifdef WO_USE_OWN_METHOD_SIGNATURE_IMPLEMENTATION
-
- return [[self alloc] initWithObjCTypes:types];
-
-#else /* use private Apple API */
-
- NSAssert([self respondsToSelector:@selector(signatureWithObjCTypes:)], @"signatureWithObjCTypes: selector not recognized");
- return [self signatureWithObjCTypes:types];
-
-#endif
-
-}
-
-- (id)initWithObjCTypes:(const char *)types
-{
- NSParameterAssert(types != NULL);
- if ((self = [super init]))
- {
- // TODO: finish implementation
- // loop through args
-/* unsigned method_getNumberOfArguments(Method);
- unsigned method_getSizeOfArguments(Method); */
-
- // I hate using private Apple APIs, even ones that appear stable, but
- // not sure that meddling with these instance variables is a good idea
- }
- return self;
-}
-
-@end
// framework headers
#import "NSInvocation+WOTest.h"
-#import "NSMethodSignature+WOTest.h"
#import "NSObject+WOTest.h"
#import "NSProxy+WOTest.h"
#import "NSValue+WOTest.h"
- (void)setObjCTypes:(NSString *)types forSelector:(SEL)aSelector
{
- [methodSignatures setObject:[NSMethodSignature WOTest_signatureBasedOnObjCTypes:[types UTF8String]]
+ [methodSignatures setObject:[NSMethodSignature signatureWithObjCTypes:[types UTF8String]]
forKey:NSStringFromSelector(aSelector)];
}
// framework headers
#import "NSInvocation+WOTest.h"
-#import "NSMethodSignature+WOTest.h"
#import "WOProtocolStub.h"
#pragma mark -
BOOL isRequiredMethod = YES; // no idea what to pass here
struct objc_method_description description = protocol_getMethodDescription([self mockedProtocol], aSelector, isRequiredMethod, YES);
- return [NSMethodSignature WOTest_signatureBasedOnObjCTypes:description.types];
+ return [NSMethodSignature signatureWithObjCTypes:description.types];
}
#pragma mark -
// framework headers
#import "NSInvocation+WOTest.h"
-#import "NSMethodSignature+WOTest.h"
#import "NSObject+WOTest.h"
#import "NSProxy+WOTest.h"
#import "NSValue+WOTest.h"
#import "NSException+WOTest.h"
#import "NSInvocation+WOTest.h"
-#import "NSMethodSignature+WOTest.h"
#import "NSObject+WOTest.h"
#import "NSProxy+WOTest.h"
#import "NSScanner+WOTest.h"
archiveVersion = 1;
classes = {
};
- objectVersion = 43;
+ objectVersion = 44;
objects = {
/* Begin PBXAggregateTarget section */
BCD155AF0A961949005B1950 /* WOProtocolMock.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCFA3172098BFD9300EEEE22 /* WOProtocolMock.h */; };
BCD155B00A961949005B1950 /* WOEnumerate.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCFA31DB098C030300EEEE22 /* WOEnumerate.h */; };
BCD155B10A961949005B1950 /* NSInvocation+WOTest.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCFA342A098DB87300EEEE22 /* NSInvocation+WOTest.h */; };
- BCD155B20A961949005B1950 /* NSMethodSignature+WOTest.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCFA35CA098E6A0D00EEEE22 /* NSMethodSignature+WOTest.h */; };
BCD155B30A961949005B1950 /* WOLightweightRoot.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCFA3CE0098F9B4800EEEE22 /* WOLightweightRoot.h */; };
BCD155B40A961949005B1950 /* WOObjectMock.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCBB58EC099D311B0065D0C5 /* WOObjectMock.h */; };
BCD155B50A961949005B1950 /* WOProtocolStub.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = BCBB59A0099D38BE0065D0C5 /* WOProtocolStub.h */; };
BCFA326D098C71D300EEEE22 /* WOObjectMockTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA326C098C71D300EEEE22 /* WOObjectMockTests.m */; };
BCFA342D098DB87300EEEE22 /* NSInvocation+WOTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA342B098DB87300EEEE22 /* NSInvocation+WOTest.m */; };
BCFA3446098E25FA00EEEE22 /* NSInvocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA3445098E25FA00EEEE22 /* NSInvocationTests.m */; };
- BCFA35CF098E6A0D00EEEE22 /* NSMethodSignature+WOTest.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA35CB098E6A0D00EEEE22 /* NSMethodSignature+WOTest.m */; };
BCFA3CE3098F9B4800EEEE22 /* WOLightweightRoot.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA3CE1098F9B4800EEEE22 /* WOLightweightRoot.m */; };
BCFA3EA8098FCF9800EEEE22 /* NSValueTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFA3EA7098FCF9700EEEE22 /* NSValueTests.m */; };
/* End PBXBuildFile section */
BCD155AF0A961949005B1950 /* WOProtocolMock.h in CopyFiles */,
BCD155B00A961949005B1950 /* WOEnumerate.h in CopyFiles */,
BCD155B10A961949005B1950 /* NSInvocation+WOTest.h in CopyFiles */,
- BCD155B20A961949005B1950 /* NSMethodSignature+WOTest.h in CopyFiles */,
BCD155B30A961949005B1950 /* WOLightweightRoot.h in CopyFiles */,
BCD155B40A961949005B1950 /* WOObjectMock.h in CopyFiles */,
BCD155B50A961949005B1950 /* WOProtocolStub.h in CopyFiles */,
BCFA342B098DB87300EEEE22 /* NSInvocation+WOTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSInvocation+WOTest.m"; sourceTree = "<group>"; };
BCFA3444098E25FA00EEEE22 /* NSInvocationTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSInvocationTests.h; path = Tests/NSInvocationTests.h; sourceTree = "<group>"; };
BCFA3445098E25FA00EEEE22 /* NSInvocationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSInvocationTests.m; path = Tests/NSInvocationTests.m; sourceTree = "<group>"; };
- BCFA35CA098E6A0D00EEEE22 /* NSMethodSignature+WOTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMethodSignature+WOTest.h"; sourceTree = "<group>"; };
- BCFA35CB098E6A0D00EEEE22 /* NSMethodSignature+WOTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMethodSignature+WOTest.m"; sourceTree = "<group>"; };
BCFA3CE0098F9B4800EEEE22 /* WOLightweightRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WOLightweightRoot.h; sourceTree = "<group>"; };
BCFA3CE1098F9B4800EEEE22 /* WOLightweightRoot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WOLightweightRoot.m; sourceTree = "<group>"; };
BCFA3EA6098FCF9700EEEE22 /* NSValueTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSValueTests.h; path = Tests/NSValueTests.h; sourceTree = "<group>"; };
BC5B1161072483FC000A7198 /* NSException+WOTest.m */,
BCFA342A098DB87300EEEE22 /* NSInvocation+WOTest.h */,
BCFA342B098DB87300EEEE22 /* NSInvocation+WOTest.m */,
- BCFA35CA098E6A0D00EEEE22 /* NSMethodSignature+WOTest.h */,
- BCFA35CB098E6A0D00EEEE22 /* NSMethodSignature+WOTest.m */,
BC1A6961085C5002004E0E61 /* NSObject+WOTest.h */,
BC1A6962085C5002004E0E61 /* NSObject+WOTest.m */,
BC7CC40D0A8E0A5D00B83673 /* NSProxy+WOTest.h */,
BCFA316D098BFD8900EEEE22 /* WOClassMock.m in Sources */,
BCFA3175098BFD9300EEEE22 /* WOProtocolMock.m in Sources */,
BCFA342D098DB87300EEEE22 /* NSInvocation+WOTest.m in Sources */,
- BCFA35CF098E6A0D00EEEE22 /* NSMethodSignature+WOTest.m in Sources */,
BCFA3CE3098F9B4800EEEE22 /* WOLightweightRoot.m in Sources */,
BCBB58EF099D31280065D0C5 /* WOObjectMock.m in Sources */,
BCBB59A5099D38BE0065D0C5 /* WOProtocolStub.m in Sources */,