Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds compatibility with Xcode 4.4.

  • Loading branch information...
commit 12bb85f16c90a621206f43db1769a7fc37d9c9c9 1 parent c469c2d
@shpakovski shpakovski authored
View
2  Kiwi/KWBeEmptyMatcher.m
@@ -54,7 +54,7 @@ - (NSString *)countPhrase {
if (self.count == 1)
return @"1 item";
else
- return [NSString stringWithFormat:@"%u items", self.count];
+ return [NSString stringWithFormat:@"%u items", (unsigned)self.count];
}
- (NSString *)failureMessageForShould {
View
2  Kiwi/KWCallSite.m
@@ -39,7 +39,7 @@ - (void)dealloc {
#pragma mark Identifying and Comparing
- (NSUInteger)hash {
- return [[NSString stringWithFormat:@"%@%u", self.filename, self.lineNumber] hash];
+ return [[NSString stringWithFormat:@"%@%u", self.filename, (unsigned)self.lineNumber] hash];
}
- (BOOL)isEqual:(id)anObject {
View
8 Kiwi/KWHaveMatcher.m
@@ -133,13 +133,13 @@ - (NSString *)actualCountPhrase {
if (self.actualCount == 1)
return @"1 item";
else
- return [NSString stringWithFormat:@"%u items", self.actualCount];
+ return [NSString stringWithFormat:@"%u items", (unsigned)self.actualCount];
}
- (NSString *)failureMessageForShould {
return [NSString stringWithFormat:@"expected subject to %@ %u %@, got %@",
[self verbPhrase],
- self.count,
+ (unsigned)self.count,
[self itemPhrase],
[self actualCountPhrase]];
}
@@ -147,7 +147,7 @@ - (NSString *)failureMessageForShould {
- (NSString *)failureMessageForShouldNot {
return [NSString stringWithFormat:@"expected subject not to %@ %u %@",
[self verbPhrase],
- self.count,
+ (unsigned)self.count,
[self itemPhrase]];
}
@@ -156,7 +156,7 @@ - (NSString *)failureMessageForShouldNot {
- (NSString *)description
{
- return [NSString stringWithFormat:@"%@ %u %@", [self verbPhrase], self.count, [self itemPhrase]];
+ return [NSString stringWithFormat:@"%@ %u %@", [self verbPhrase], (unsigned)self.count, [self itemPhrase]];
}
#pragma mark -
View
6 Kiwi/KWIntercept.m
@@ -162,7 +162,8 @@ Class KWRestoreOriginalClass(id anObject) {
if (KWClassIsInterceptClass(interceptClass))
{
Class originalClass = class_getSuperclass(interceptClass);
- anObject->isa = originalClass;
+ // anObject->isa = originalClass;
+ object_setClass(anObject, originalClass);
}
return interceptClass;
}
@@ -191,7 +192,8 @@ void KWInterceptedForwardInvocation(id anObject, SEL aSelector, NSInvocation* an
Class interceptClass = KWRestoreOriginalClass(anObject);
[anInvocation invoke];
- anObject->isa = interceptClass;
+ // anObject->isa = interceptClass;
+ object_setClass(anObject, interceptClass);
}
void KWInterceptedDealloc(id anObject, SEL aSelector) {
View
4 Kiwi/KWMatcherFactory.m
@@ -73,8 +73,10 @@ - (void)registerMatcherClassesWithNamespacePrefix:(NSString *)aNamespacePrefix {
Class *classes = malloc(sizeof(Class) * numberOfClasses);
numberOfClasses = objc_getClassList(classes, numberOfClasses);
- if (numberOfClasses == 0)
+ if (numberOfClasses == 0) {
+ free(classes);
return;
+ }
for (int i = 0; i < numberOfClasses; ++i) {
Class candidateClass = classes[i];
View
6 Kiwi/KWMessageTracker.m
@@ -96,7 +96,7 @@ - (NSString *)phraseForCount:(NSUInteger)aCount {
if (aCount == 1)
return @"1 time";
- return [NSString stringWithFormat:@"%d times", aCount];
+ return [NSString stringWithFormat:@"%d times", (int)aCount];
}
- (NSString *)expectedCountPhrase {
@@ -144,8 +144,8 @@ - (NSString *)description {
return [NSString stringWithFormat:@"messagePattern: %@\nmode: %@\ncount: %d\nreceiveCount: %d",
self.messagePattern,
self.modeString,
- self.count,
- self.receivedCount];
+ (int)self.count,
+ (int)self.receivedCount];
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.