diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2015-05-21 17:14:52 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2015-05-22 14:27:31 -0400 |
commit | 1dcc329427fd103a0abd96ab787270f5d0a31861 (patch) | |
tree | cf1c52df0e1effa3d0985a3406a71c38c3a4e487 /objectivec/Tests/GPBMessageTests+Runtime.m | |
parent | c3480926f98eb7c45224daae5cf0373e120b3b8d (diff) | |
download | protobuf-1dcc329427fd103a0abd96ab787270f5d0a31861.tar.gz protobuf-1dcc329427fd103a0abd96ab787270f5d0a31861.tar.bz2 protobuf-1dcc329427fd103a0abd96ab787270f5d0a31861.zip |
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.
Diffstat (limited to 'objectivec/Tests/GPBMessageTests+Runtime.m')
-rw-r--r-- | objectivec/Tests/GPBMessageTests+Runtime.m | 11 |
1 files changed, 7 insertions, 4 deletions
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; } |