From 1dcc329427fd103a0abd96ab787270f5d0a31861 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 21 May 2015 17:14:52 -0400 Subject: Objective C Second Alpha Drop - Style fixups in the code. - map<> serialization fixes and more tests. - Autocreation of map<> fields (to match repeated fields). - @@protoc_insertion_point(global_scope|imports). - Fixup proto2 syntax extension support. - Move all startup code to +initialize so it happen on class usage and not app startup. - Have generated headers use forward declarations and move imports into generated code, reduces what is need at compile time to speed up compiled and avoid pointless rippling of rebuilds. --- objectivec/Tests/GPBMessageTests+Runtime.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'objectivec/Tests/GPBMessageTests+Runtime.m') diff --git a/objectivec/Tests/GPBMessageTests+Runtime.m b/objectivec/Tests/GPBMessageTests+Runtime.m index 6ad29ca5..4621f90f 100644 --- a/objectivec/Tests/GPBMessageTests+Runtime.m +++ b/objectivec/Tests/GPBMessageTests+Runtime.m @@ -35,6 +35,7 @@ #import "GPBMessage.h" #import "google/protobuf/MapUnittest.pbobjc.h" +#import "google/protobuf/Unittest.pbobjc.h" #import "google/protobuf/UnittestRuntimeProto2.pbobjc.h" #import "google/protobuf/UnittestRuntimeProto3.pbobjc.h" @@ -772,6 +773,8 @@ XCTAssertThrowsSpecificNamed(msg.oneofEnum = 666, NSException, NSInvalidArgumentException); XCTAssertEqual(msg.oneofEnum, Message2_Enum_Bar); + + [msg release]; } - (void)testAccessingProto3UnknownEnumValues { @@ -1261,7 +1264,7 @@ Message2_O_OneOfCase_OneofEnum, }; - for (size_t i = 0; i < (sizeof(values) / sizeof((values[0]))); ++i) { + for (size_t i = 0; i < GPBARRAYSIZE(values); ++i) { switch (values[i]) { case Message2_O_OneOfCase_OneofInt32: msg.oneofInt32 = 1; @@ -1318,7 +1321,7 @@ msg.oneofEnum = Message2_Enum_Bar; break; default: - XCTFail(@"shouldn't happen, loop: %zd", i); + XCTFail(@"shouldn't happen, loop: %zd, value: %d", i, values[i]); break; } @@ -1770,7 +1773,7 @@ Message3_O_OneOfCase_OneofEnum, }; - for (size_t i = 0; i < (sizeof(values) / sizeof((values[0]))); ++i) { + for (size_t i = 0; i < GPBARRAYSIZE(values); ++i) { switch (values[i]) { case Message3_O_OneOfCase_OneofInt32: msg.oneofInt32 = 1; @@ -1824,7 +1827,7 @@ msg.oneofEnum = Message3_Enum_Baz; break; default: - XCTFail(@"shouldn't happen, loop: %zd", i); + XCTFail(@"shouldn't happen, loop: %zd, value: %d", i, values[i]); break; } -- cgit v1.2.3