diff --git a/Expecta.xcodeproj/project.pbxproj b/Expecta.xcodeproj/project.pbxproj index 5a658f2..2b4db0c 100644 --- a/Expecta.xcodeproj/project.pbxproj +++ b/Expecta.xcodeproj/project.pbxproj @@ -1216,7 +1216,7 @@ attributes = { CLASSPREFIX = EXP; LastTestingUpgradeCheck = 0630; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = "Peter Jihoon Kim"; TargetAttributes = { 908379101A8B9660009844DA = { @@ -1672,6 +1672,7 @@ 3A0A59891AD4418C003DA3E4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; @@ -1691,6 +1692,7 @@ 3A0A598A1AD4418C003DA3E4 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; @@ -1710,6 +1712,7 @@ 3A0A598B1AD4418C003DA3E4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; @@ -1729,6 +1732,7 @@ 3A0A59BC1AD441CB003DA3E4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INFOPLIST_FILE = "Tests/Support/Test-Info.plist"; @@ -1749,6 +1753,7 @@ 3A0A59BD1AD441CB003DA3E4 /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INFOPLIST_FILE = "Tests/Support/Test-Info.plist"; @@ -1769,6 +1774,7 @@ 3A0A59BE1AD441CB003DA3E4 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INFOPLIST_FILE = "Tests/Support/Test-Info.plist"; @@ -1789,6 +1795,8 @@ 908379251A8B9661009844DA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1810,6 +1818,8 @@ 908379261A8B9661009844DA /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1831,6 +1841,8 @@ 908379271A8B9661009844DA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1852,6 +1864,7 @@ 9083798D1A8B972C009844DA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1874,6 +1887,7 @@ 9083798E1A8B972C009844DA /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1896,6 +1910,7 @@ 9083798F1A8B972C009844DA /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1918,6 +1933,7 @@ 9C44170917FF3F4A00978F09 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", @@ -1940,6 +1956,7 @@ 9C44170A17FF3F4A00978F09 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", @@ -1963,14 +1980,39 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = ""; - IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; @@ -1983,6 +2025,7 @@ BE5C179F18EDFA93003A13EC /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; @@ -1995,6 +2038,7 @@ BE5C17A018EDFA93003A13EC /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INSTALL_PATH = /; @@ -2010,6 +2054,7 @@ BE5C17A218EDFA93003A13EC /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -2032,6 +2077,7 @@ BE5C17A318EDFA93003A13EC /* Test */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", @@ -2054,6 +2100,7 @@ E93067EE13B2E6D100EA26FF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INSTALL_PATH = /; @@ -2069,6 +2116,7 @@ E93067EF13B2E6D100EA26FF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; INSTALL_PATH = /; @@ -2084,6 +2132,7 @@ E93067F013B2E6D100EA26FF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -2106,6 +2155,7 @@ E93067F113B2E6D100EA26FF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", @@ -2129,15 +2179,40 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = DEBUG; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = ""; - IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; @@ -2151,11 +2226,36 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = ""; - IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_LDFLAGS = "-ObjC"; SDKROOT = macosx; @@ -2167,6 +2267,7 @@ E9ACDF3013B2DD520010F4D7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; @@ -2179,6 +2280,7 @@ E9ACDF3113B2DD520010F4D7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "$(SRCROOT)/Expecta/Expecta-Prefix.pch"; diff --git a/Expecta.xcodeproj/xcshareddata/xcschemes/Expecta-iOS.xcscheme b/Expecta.xcodeproj/xcshareddata/xcschemes/Expecta-iOS.xcscheme index db63587..92f6b24 100644 --- a/Expecta.xcodeproj/xcshareddata/xcschemes/Expecta-iOS.xcscheme +++ b/Expecta.xcodeproj/xcshareddata/xcschemes/Expecta-iOS.xcscheme @@ -1,6 +1,6 @@ { NSString *_expected; } +- (instancetype)init NS_UNAVAILABLE; - (instancetype)initWithExpected:(NSString *)expected NS_DESIGNATED_INITIALIZER; @end diff --git a/Tests/ExpectationTest.m b/Tests/ExpectationTest.m index 2aa0fca..b64c84a 100644 --- a/Tests/ExpectationTest.m +++ b/Tests/ExpectationTest.m @@ -16,6 +16,9 @@ + (NSUInteger)instanceCount; @implementation ExpectedObject +// This method is declared to prevent "undeclared selector" compiler warnings +- (void)foo {} + - (instancetype)init { if (self = [super init]) { ++_instanceCount; @@ -180,7 +183,7 @@ - (void)test_expect_NSUInteger { } - (void)test_expect_block { - void (^b)() = ^{}; + void (^b)(void) = ^{}; void (^b2)(int a) = ^(int a) {}; assertEqualObjects(expect(b).actual, b); assertEqualObjects(expect(b2).actual, b2); diff --git a/Tests/Helpers/FakeTestCase.m b/Tests/Helpers/FakeTestCase.m index fe87fb8..1834c47 100644 --- a/Tests/Helpers/FakeTestCase.m +++ b/Tests/Helpers/FakeTestCase.m @@ -7,7 +7,7 @@ - (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected { - [NSException raise:description format:nil]; + [NSException raise:description format:@""]; } @end diff --git a/Tests/Matchers/EXPMatchers+equalTest.m b/Tests/Matchers/EXPMatchers+equalTest.m index 6ca1cbd..14f30ca 100644 --- a/Tests/Matchers/EXPMatchers+equalTest.m +++ b/Tests/Matchers/EXPMatchers+equalTest.m @@ -7,6 +7,11 @@ @interface EXPMatchers_equalTest : XCTestCase @implementation EXPMatchers_equalTest +// These methods are declared to prevent "undeclared selector" compiler warnings +- (void)foo {} +- (void)bar {} +- (void)bar:(id)arg {} + - (void)test_equal_nil { assertPass(test_expect(nil).equal(nil)); assertFail(test_expect(@"foo").equal(nil), @"expected: nil/null, got: foo"); @@ -166,8 +171,8 @@ - (void)test_equal_nullPointer { } - (void)test_equal_block { - void (^block)() = ^{}; - void (^block2)() = ^{}; + void (^block)(void) = ^{}; + void (^block2)(void) = ^{}; assertPass(test_expect(block).equal(block)); assertPass(test_expect(block).toNot.equal(block2)); } diff --git a/Tests/Matchers/EXPMatchers+raiseTest.m b/Tests/Matchers/EXPMatchers+raiseTest.m index 155e028..96c7f4e 100644 --- a/Tests/Matchers/EXPMatchers+raiseTest.m +++ b/Tests/Matchers/EXPMatchers+raiseTest.m @@ -7,11 +7,11 @@ @implementation EXPMatchers_raiseTest - (void)test_raise { assertPass(test_expect(^{ - [NSException raise:@"TestException" format:nil]; + [NSException raise:@"TestException" format:@""]; }).to.raiseAny()); assertPass(test_expect(^{ - [NSException raise:@"TestException" format:nil]; + [NSException raise:@"TestException" format:@""]; }).to.raise(@"TestException")); assertFail(test_expect(^{ @@ -26,11 +26,11 @@ - (void)test_raise { - (void)test_toNot_raise { assertFail(test_expect(^{ - [NSException raise:@"TestException" format:nil]; + [NSException raise:@"TestException" format:@""]; }).notTo.raiseAny(), @"expected: no exception, got: TestException"); assertFail(test_expect(^{ - [NSException raise:@"TestException" format:nil]; + [NSException raise:@"TestException" format:@""]; }).notTo.raise(@"TestException"), @"expected: not TestException, got: TestException"); assertPass(test_expect(^{