Browse files

Fix compile warnings.

  • Loading branch information...
1 parent b7bd3c7 commit 36336061e7ff65752e0c6bfa2add2fbf34fe9431 @gabriel gabriel committed Jan 29, 2014
View
2 Classes-iOS/GHUnitIOSViewController.m
@@ -283,7 +283,7 @@ - (void)testRunnerDidEnd:(GHTestRunner *)runner {
if (getenv("GHUNIT_AUTOEXIT")) {
NSLog(@"Exiting (GHUNIT_AUTOEXIT)");
- exit(runner.test.stats.failureCount);
+ exit((int)runner.test.stats.failureCount);
}
}
View
4 Classes-iOS/GHViewTestCase.m
@@ -267,11 +267,11 @@ - (void)verifyView:(UIView *)view filename:(NSString *)filename lineNumber:(int)
}
// View testing file names have the format [test class name]-[test selector name]-[UIScreen scale]-[# of verify in selector]-[view class name]
- NSString *imageFilenamePrefix = [NSString stringWithFormat:@"%@-%@-%1.0f-%d-%@",
+ NSString *imageFilenamePrefix = [NSString stringWithFormat:@"%@-%@-%1.0f-%@-%@",
NSStringFromClass([self class]),
NSStringFromSelector(currentSelector_),
[[UIScreen mainScreen] scale],
- imageVerifyCount_,
+ @(imageVerifyCount_),
NSStringFromClass([view class])];
NSString *imageFilename = [imageFilenamePrefix stringByAppendingString:@".png"];
UIImage *originalViewImage = [[self class] readSavedTestImageWithFilename:imageFilename];
View
3 Classes/GHTest/GHTest.m
@@ -64,8 +64,7 @@ GHTestStats GHTestStatsMake(NSInteger succeedCount, NSInteger failureCount, NSIn
const GHTestStats GHTestStatsEmpty = {0, 0, 0, 0};
NSString *NSStringFromGHTestStats(GHTestStats stats) {
- return [NSString stringWithFormat:@"%d/%d/%d/%d", stats.succeedCount, stats.failureCount,
- stats.cancelCount, stats.testCount];
+ return [NSString stringWithFormat:@"%@/%@/%@/%@", @(stats.succeedCount), @(stats.failureCount), @(stats.cancelCount), @(stats.testCount)];
}
BOOL GHTestStatusIsRunning(GHTestStatus status) {
View
4 Classes/GHTest/GHTestGroup+JUnitXML.m
@@ -48,8 +48,8 @@ - (BOOL)writeJUnitXMLAtPath:(NSString *)path error:(NSError **)error {
- (NSString *)JUnitXML {
NSMutableString *JUnitXML = [NSMutableString stringWithFormat:
- @"<testsuite name=\"%@\" tests=\"%d\" failures=\"%d\" time=\"%0.4f\">",
- self.name, self.stats.testCount, self.stats.failureCount, self.interval];
+ @"<testsuite name=\"%@\" tests=\"%@\" failures=\"%@\" time=\"%0.4f\">",
+ self.name, @(self.stats.testCount), @(self.stats.failureCount), self.interval];
for (id child in self.children) {
if ([child respondsToSelector:@selector(JUnitXML)])
View
4 Classes/GHTest/GHTestGroup.m
@@ -81,8 +81,8 @@ - (void)dealloc {
}
- (NSString *)description {
- return [NSString stringWithFormat:@"%@, %d %0.3f %d/%d (%d failures)",
- name_, status_, interval_, stats_.succeedCount, stats_.testCount, stats_.failureCount];
+ return [NSString stringWithFormat:@"%@, %d %0.3f %@/%@ (%@ failures)",
+ name_, status_, interval_, @(stats_.succeedCount), @(stats_.testCount), @(stats_.failureCount)];
}
- (NSString *)name {
View
10 Classes/GHTest/GHTestRunner.m
@@ -252,13 +252,13 @@ - (void)_notifyCancelled {
- (void)_notifyFinished {
NSString *message = [NSString stringWithFormat:@"Test Suite '%@' finished.\n"
- "Executed %d of %d tests, with %d failures in %0.3f seconds (%d disabled).\n",
+ "Executed %@ of %@ tests, with %@ failures in %0.3f seconds (%@ disabled).\n",
[test_ name],
- ([test_ stats].succeedCount + [test_ stats].failureCount),
- [test_ stats].testCount,
- [test_ stats].failureCount,
+ @([test_ stats].succeedCount + [test_ stats].failureCount),
+ @([test_ stats].testCount),
+ @([test_ stats].failureCount),
[test_ interval],
- [test_ disabledCount]];
+ @([test_ disabledCount])];
[self log:message];
if ([test_ isKindOfClass:[GHTestGroup class]]) {
View
8 Classes/Mock/GHMockNSURLConnection.m
@@ -70,7 +70,7 @@ - (void)receiveData:(NSData *)data afterDelay:(NSTimeInterval)delay {
if (delay < 0) {
[delegate_ connection:(NSURLConnection *)self didReceiveData:data];
} else {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[delegate_ connection:(NSURLConnection *)self didReceiveData:data];
});
}
@@ -115,7 +115,7 @@ - (void)receiveResponse:(NSURLResponse *)response afterDelay:(NSTimeInterval)del
if (delay < 0) {
[delegate_ connection:(NSURLConnection *)self didReceiveResponse:response];
} else {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[delegate_ connection:(NSURLConnection *)self didReceiveResponse:response];
});
}
@@ -125,7 +125,7 @@ - (void)finishAfterDelay:(NSTimeInterval)delay {
if (delay < 0) {
[delegate_ connectionDidFinishLoading:(NSURLConnection *)self];
} else {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[delegate_ connectionDidFinishLoading:(NSURLConnection *)self];
});
}
@@ -135,7 +135,7 @@ - (void)failWithError:(NSError *)error afterDelay:(NSTimeInterval)delay {
if (delay < 0) {
[delegate_ connection:(NSURLConnection *)self didFailWithError:error];
} else {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[delegate_ connection:(NSURLConnection *)self didFailWithError:error];
});
}
View
4 Classes/SharedUI/GHTestViewModel.h
@@ -39,10 +39,10 @@
- (void)testNodeDidChange:(GHTestNode *)node;
@end
-typedef enum {
+typedef NS_ENUM(NSInteger, GHTestNodeFilter) {
GHTestNodeFilterNone = 0,
GHTestNodeFilterFailed = 1
-} GHTestNodeFilter;
+};
/*!
Test view model for use in a tree view.
View
10 Classes/SharedUI/GHTestViewModel.m
@@ -63,8 +63,8 @@ - (NSString *)name {
- (NSString *)statusString:(NSString *)prefix {
NSInteger totalRunCount = [suite_ stats].testCount - ([suite_ disabledCount] + [suite_ stats].cancelCount);
NSString *statusInterval = [NSString stringWithFormat:@"%@ %0.3fs (%0.3fs in test time)", (self.isRunning ? @"Running" : @"Took"), runner_.interval, [suite_ interval]];
- return [NSString stringWithFormat:@"%@%@ %d/%d (%d failures)", prefix, statusInterval,
- [suite_ stats].succeedCount, totalRunCount, [suite_ stats].failureCount];
+ return [NSString stringWithFormat:@"%@%@ %@/%@ (%@ failures)", prefix, statusInterval,
+ @([suite_ stats].succeedCount), @(totalRunCount), @([suite_ stats].failureCount)];
}
- (void)registerNode:(GHTestNode *)node {
@@ -325,9 +325,9 @@ - (NSString *)statusString {
}
if (self.isGroupTest) {
- NSString *statsString = [NSString stringWithFormat:@"%d/%d (%d failed)",
- ([test_ stats].succeedCount+[test_ stats].failureCount),
- [test_ stats].testCount, [test_ stats].failureCount];
+ NSString *statsString = [NSString stringWithFormat:@"%@/%@ (%@ failed)",
+ @([test_ stats].succeedCount+[test_ stats].failureCount),
+ @([test_ stats].testCount), @([test_ stats].failureCount)];
return [NSString stringWithFormat:@"%@ %@ %@", status, statsString, interval];
} else {
return [NSString stringWithFormat:@"%@ %@", status, interval];
View
3 Project-iOS/GHUnitIOS.xcodeproj/project.pbxproj
@@ -737,7 +737,7 @@
0041C5E113BA7B8A0015FC22 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0430;
+ LastUpgradeCheck = 0500;
};
buildConfigurationList = 0041C5E413BA7B8A0015FC22 /* Build configuration list for PBXProject "GHUnitIOS" */;
compatibilityVersion = "Xcode 3.2";
@@ -944,6 +944,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
View
2 Tests/GHAsyncTestCaseTest.m
@@ -93,7 +93,7 @@ - (BOOL)shouldRunOnMainThread {
// This test crashes
- (void)_test_EXPECTED {
[self prepare];
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[NSException raise:NSGenericException format:@"Test exception"];
});
[self waitForStatus:kGHUnitWaitStatusSuccess timeout:1.0];
View
2 Tests/GHTestUtilsTest.m
@@ -62,7 +62,7 @@ - (void)testRunWhile {
}
- (void)testRunWhileTimesOut {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_current_queue(), ^{
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
_value = YES;
});
GHRunUntilTimeoutWhileBlock(0.1, ^BOOL{

0 comments on commit 3633606

Please sign in to comment.