Commit ca428c1b authored by Thomas Van Lenten's avatar Thomas Van Lenten

Have the tests rely on the autocreator behaviors.

Incase developers look at the tests for examples, have them rely on the
autocreators also.
parent 2f15b8f5
...@@ -675,13 +675,11 @@ ...@@ -675,13 +675,11 @@
TestAllTypes *subMsg = [TestAllTypes message]; TestAllTypes *subMsg = [TestAllTypes message];
subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:100]; subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:100];
msg1.mapInt32Message = [GPBInt32ObjectDictionary dictionary];
[msg1.mapInt32Message setObject:subMsg forKey:0]; [msg1.mapInt32Message setObject:subMsg forKey:0];
subMsg = nil; subMsg = nil;
subMsg = [TestAllTypes message]; subMsg = [TestAllTypes message];
subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:101]; subMsg.repeatedInt32Array = [GPBInt32Array arrayWithValue:101];
msg2.mapInt32Message = [GPBInt32ObjectDictionary dictionary];
[msg2.mapInt32Message setObject:subMsg forKey:0]; [msg2.mapInt32Message setObject:subMsg forKey:0];
subMsg = nil; subMsg = nil;
......
...@@ -2074,7 +2074,6 @@ ...@@ -2074,7 +2074,6 @@
// Add an uninitialized message. // Add an uninitialized message.
TestRequired *subMsg = [[TestRequired alloc] init]; TestRequired *subMsg = [[TestRequired alloc] init];
msg.mapField = [GPBInt32ObjectDictionary dictionary];
[msg.mapField setObject:subMsg forKey:0]; [msg.mapField setObject:subMsg forKey:0];
XCTAssertFalse(msg.initialized); XCTAssertFalse(msg.initialized);
......
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
[message setOptionalInt32:1]; [message setOptionalInt32:1];
[message setOptionalString:@"foo"]; [message setOptionalString:@"foo"];
[message setOptionalForeignMessage:[ForeignMessage message]]; [message setOptionalForeignMessage:[ForeignMessage message]];
message.repeatedStringArray = [NSMutableArray array];
[message.repeatedStringArray addObject:@"bar"]; [message.repeatedStringArray addObject:@"bar"];
return message; return message;
} }
...@@ -67,7 +66,6 @@ ...@@ -67,7 +66,6 @@
ForeignMessage *foreignMessage = [ForeignMessage message]; ForeignMessage *foreignMessage = [ForeignMessage message];
[foreignMessage setC:3]; [foreignMessage setC:3];
[message setOptionalForeignMessage:foreignMessage]; [message setOptionalForeignMessage:foreignMessage];
message.repeatedStringArray = [NSMutableArray array];
[message.repeatedStringArray addObject:@"qux"]; [message.repeatedStringArray addObject:@"qux"];
return message; return message;
} }
...@@ -76,7 +74,6 @@ ...@@ -76,7 +74,6 @@
TestAllTypes *message = [TestAllTypes message]; TestAllTypes *message = [TestAllTypes message];
[message setOptionalInt64:2]; [message setOptionalInt64:2];
[message setOptionalString:@"baz"]; [message setOptionalString:@"baz"];
message.repeatedStringArray = [NSMutableArray array];
[message.repeatedStringArray addObject:@"qux"]; [message.repeatedStringArray addObject:@"qux"];
return message; return message;
} }
...@@ -89,7 +86,6 @@ ...@@ -89,7 +86,6 @@
ForeignMessage *foreignMessage = [ForeignMessage message]; ForeignMessage *foreignMessage = [ForeignMessage message];
[foreignMessage setC:3]; [foreignMessage setC:3];
[message setOptionalForeignMessage:foreignMessage]; [message setOptionalForeignMessage:foreignMessage];
message.repeatedStringArray = [NSMutableArray array];
[message.repeatedStringArray addObject:@"qux"]; [message.repeatedStringArray addObject:@"qux"];
[message.repeatedStringArray addObject:@"bar"]; [message.repeatedStringArray addObject:@"bar"];
return message; return message;
...@@ -102,7 +98,6 @@ ...@@ -102,7 +98,6 @@
[message setOptionalString:@"foo"]; [message setOptionalString:@"foo"];
ForeignMessage *foreignMessage = [ForeignMessage message]; ForeignMessage *foreignMessage = [ForeignMessage message];
[message setOptionalForeignMessage:foreignMessage]; [message setOptionalForeignMessage:foreignMessage];
message.repeatedStringArray = [NSMutableArray array];
[message.repeatedStringArray addObject:@"qux"]; [message.repeatedStringArray addObject:@"qux"];
[message.repeatedStringArray addObject:@"bar"]; [message.repeatedStringArray addObject:@"bar"];
return message; return message;
...@@ -248,7 +243,6 @@ ...@@ -248,7 +243,6 @@
[message setOptionalMessage:self.testRequiredInitialized]; [message setOptionalMessage:self.testRequiredInitialized];
XCTAssertTrue(message.initialized); XCTAssertTrue(message.initialized);
message.repeatedMessageArray = [NSMutableArray array];
[message.repeatedMessageArray addObject:[TestRequired message]]; [message.repeatedMessageArray addObject:[TestRequired message]];
XCTAssertFalse(message.initialized); XCTAssertFalse(message.initialized);
...@@ -300,7 +294,6 @@ ...@@ -300,7 +294,6 @@
- (void)testDataFromNestedUninitialized { - (void)testDataFromNestedUninitialized {
TestRequiredForeign *message = [TestRequiredForeign message]; TestRequiredForeign *message = [TestRequiredForeign message];
[message setOptionalMessage:[TestRequired message]]; [message setOptionalMessage:[TestRequired message]];
message.repeatedMessageArray = [NSMutableArray array];
[message.repeatedMessageArray addObject:[TestRequired message]]; [message.repeatedMessageArray addObject:[TestRequired message]];
[message.repeatedMessageArray addObject:[TestRequired message]]; [message.repeatedMessageArray addObject:[TestRequired message]];
NSData *data = [message data]; NSData *data = [message data];
...@@ -319,7 +312,6 @@ ...@@ -319,7 +312,6 @@
TestRequiredForeign *message = [TestRequiredForeign message]; TestRequiredForeign *message = [TestRequiredForeign message];
[message setOptionalMessage:[TestRequired message]]; [message setOptionalMessage:[TestRequired message]];
message.repeatedMessageArray = [NSMutableArray array];
[message.repeatedMessageArray addObject:[TestRequired message]]; [message.repeatedMessageArray addObject:[TestRequired message]];
[message.repeatedMessageArray addObject:[TestRequired message]]; [message.repeatedMessageArray addObject:[TestRequired message]];
......
...@@ -190,7 +190,6 @@ const int kUnknownTypeId = 1550055; ...@@ -190,7 +190,6 @@ const int kUnknownTypeId = 1550055;
TestMessageSetExtension1* message = [TestMessageSetExtension1 message]; TestMessageSetExtension1* message = [TestMessageSetExtension1 message];
message.i = 123; message.i = 123;
item.message = [message data]; item.message = [message data];
raw.itemArray = [NSMutableArray array];
[raw.itemArray addObject:item]; [raw.itemArray addObject:item];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment