From e8a257577de73e6844a2f35baa55ea0590479de9 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 25 Mar 2016 12:03:41 +0100 Subject: [PATCH] mobile/bind/objc: treat warnings as errors in SeqTest.m Warnings used to be invisible when running SeqTest.m through go test. Treat warnings as errors and fix a bug that surfaced. Change-Id: I81e7291635824cdb4a898c91db740f7aa10f3611 Reviewed-on: https://go-review.googlesource.com/21133 Reviewed-by: David Crawshaw --- bind/objc/SeqTest.m | 2 +- bind/objc/xcodetest/xcodetest.xcodeproj/project.pbxproj | 2 ++ bind/testpkg/testpkg.go | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bind/objc/SeqTest.m b/bind/objc/SeqTest.m index 7b196f5..a945b04 100644 --- a/bind/objc/SeqTest.m +++ b/bind/objc/SeqTest.m @@ -369,7 +369,7 @@ static int numI = 0; - (void)testIDup { Number *want = [[Number alloc] init]; - Number *got = GoTestpkgIDup(want); + Number *got = (Number *)GoTestpkgI2Dup(want); XCTAssertEqual(got, want, @"ObjC object passed through Go should not be wrapped"); } diff --git a/bind/objc/xcodetest/xcodetest.xcodeproj/project.pbxproj b/bind/objc/xcodetest/xcodetest.xcodeproj/project.pbxproj index 002a71a..ac417db 100644 --- a/bind/objc/xcodetest/xcodetest.xcodeproj/project.pbxproj +++ b/bind/objc/xcodetest/xcodetest.xcodeproj/project.pbxproj @@ -189,6 +189,7 @@ "DEBUG=1", "$(inherited)", ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -227,6 +228,7 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; diff --git a/bind/testpkg/testpkg.go b/bind/testpkg/testpkg.go index b9ab811..366a539 100644 --- a/bind/testpkg/testpkg.go +++ b/bind/testpkg/testpkg.go @@ -143,6 +143,10 @@ func NumSCollected() int { return numSCollected } +func I2Dup(i I2) I2 { + return i +} + func IDup(i I) I { return i }