aboutsummaryrefslogtreecommitdiff
path: root/objectivec/Tests/GPBMessageTests+Serialization.m
diff options
context:
space:
mode:
authorBo Yang <teboring@teboring-macpro.roam.corp.google.com>2015-05-25 12:48:03 -0700
committerBo Yang <teboring@teboring-macpro.roam.corp.google.com>2015-05-25 12:48:03 -0700
commit50a765ba03ddf311a4facc78104903e3ba5b3e8b (patch)
tree01b36604d8f6a9579fa160e43477f381f22524d7 /objectivec/Tests/GPBMessageTests+Serialization.m
parentad0a5cab521d86fcadb8991427395e77daca71a6 (diff)
downloadprotobuf-50a765ba03ddf311a4facc78104903e3ba5b3e8b.tar.gz
protobuf-50a765ba03ddf311a4facc78104903e3ba5b3e8b.tar.bz2
protobuf-50a765ba03ddf311a4facc78104903e3ba5b3e8b.zip
Fix bugs in objective-c.
Diffstat (limited to 'objectivec/Tests/GPBMessageTests+Serialization.m')
-rw-r--r--objectivec/Tests/GPBMessageTests+Serialization.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/objectivec/Tests/GPBMessageTests+Serialization.m b/objectivec/Tests/GPBMessageTests+Serialization.m
index 8867f56d..0859f14c 100644
--- a/objectivec/Tests/GPBMessageTests+Serialization.m
+++ b/objectivec/Tests/GPBMessageTests+Serialization.m
@@ -177,6 +177,13 @@ static NSData *DataFromCStr(const char *str) {
XCTAssertEqual([field.varintList valueAtIndex:0],
(uint64_t)Message3_Enum_Extra3);
+ // TODO(teboring): This test could fail without explicitly marking the repeated_enum in Message3
+ // to be unpacked. This is becaucse proto3 repeated primitive field is packed by default. However,
+ // the proto2 primitive repeated field is still unpacked by default. Previously, parsing of the
+ // repeated_enum field would fail. To fix it:
+ // 1) Objective-C implementation of parsing should be able to parse packed field for unpacked
+ // field and vice versa.
+ // 2) repeated_packed_enum in Message3 should be removed, because it's unnecessary now.
field = [unknownFields getField:Message2_FieldNumber_RepeatedEnumArray];
XCTAssertEqual(field.varintList.count, 1U);
XCTAssertEqual([field.varintList valueAtIndex:0],