• Home
  • Raw
  • Download

Lines Matching refs:message

95 - (void)modifyRepeatedExtensions:(TestAllExtensions *)message {
96 [message setExtension:[UnittestRoot repeatedInt32Extension]
99 [message setExtension:[UnittestRoot repeatedInt64Extension]
102 [message setExtension:[UnittestRoot repeatedUint32Extension]
105 [message setExtension:[UnittestRoot repeatedUint64Extension]
108 [message setExtension:[UnittestRoot repeatedSint32Extension]
111 [message setExtension:[UnittestRoot repeatedSint64Extension]
114 [message setExtension:[UnittestRoot repeatedFixed32Extension]
117 [message setExtension:[UnittestRoot repeatedFixed64Extension]
120 [message setExtension:[UnittestRoot repeatedSfixed32Extension]
123 [message setExtension:[UnittestRoot repeatedSfixed64Extension]
126 [message setExtension:[UnittestRoot repeatedFloatExtension]
129 [message setExtension:[UnittestRoot repeatedDoubleExtension]
132 [message setExtension:[UnittestRoot repeatedBoolExtension]
135 [message setExtension:[UnittestRoot repeatedStringExtension]
138 [message setExtension:[UnittestRoot repeatedBytesExtension]
142 RepeatedGroup_extension *repeatedGroup = [RepeatedGroup_extension message];
144 [message setExtension:[UnittestRoot repeatedGroupExtension]
148 [TestAllTypes_NestedMessage message];
150 [message setExtension:[UnittestRoot repeatedNestedMessageExtension]
153 ForeignMessage *foreignMessage = [ForeignMessage message];
155 [message setExtension:[UnittestRoot repeatedForeignMessageExtension]
158 ImportMessage *importMessage = [ImportMessage message];
160 [message setExtension:[UnittestRoot repeatedImportMessageExtension]
164 [message setExtension:[UnittestRoot repeatedNestedEnumExtension]
167 [message setExtension:[UnittestRoot repeatedForeignEnumExtension]
170 [message setExtension:[UnittestRoot repeatedImportEnumExtension]
174 [message setExtension:[UnittestRoot repeatedStringPieceExtension]
177 [message setExtension:[UnittestRoot repeatedCordExtension]
182 - (void)assertAllExtensionsSet:(TestAllExtensions *)message
184 XCTAssertTrue([message hasExtension:[UnittestRoot optionalInt32Extension]]);
185 XCTAssertTrue([message hasExtension:[UnittestRoot optionalInt64Extension]]);
186 XCTAssertTrue([message hasExtension:[UnittestRoot optionalUint32Extension]]);
187 XCTAssertTrue([message hasExtension:[UnittestRoot optionalUint64Extension]]);
188 XCTAssertTrue([message hasExtension:[UnittestRoot optionalSint32Extension]]);
189 XCTAssertTrue([message hasExtension:[UnittestRoot optionalSint64Extension]]);
190 XCTAssertTrue([message hasExtension:[UnittestRoot optionalFixed32Extension]]);
191 XCTAssertTrue([message hasExtension:[UnittestRoot optionalFixed64Extension]]);
192 XCTAssertTrue([message hasExtension:[UnittestRoot optionalSfixed32Extension]]);
193 XCTAssertTrue([message hasExtension:[UnittestRoot optionalSfixed64Extension]]);
194 XCTAssertTrue([message hasExtension:[UnittestRoot optionalFloatExtension]]);
195 XCTAssertTrue([message hasExtension:[UnittestRoot optionalDoubleExtension]]);
196 XCTAssertTrue([message hasExtension:[UnittestRoot optionalBoolExtension]]);
197 XCTAssertTrue([message hasExtension:[UnittestRoot optionalStringExtension]]);
198 XCTAssertTrue([message hasExtension:[UnittestRoot optionalBytesExtension]]);
200 XCTAssertTrue([message hasExtension:[UnittestRoot optionalGroupExtension]]);
201 XCTAssertTrue([message hasExtension:[UnittestRoot optionalNestedMessageExtension]]);
202 XCTAssertTrue([message hasExtension:[UnittestRoot optionalForeignMessageExtension]]);
203 XCTAssertTrue([message hasExtension:[UnittestRoot optionalImportMessageExtension]]);
205 XCTAssertTrue([[message getExtension:[UnittestRoot optionalGroupExtension]] hasA]);
206 XCTAssertTrue([[message getExtension:[UnittestRoot optionalNestedMessageExtension]] hasBb]);
207 XCTAssertTrue([[message getExtension:[UnittestRoot optionalForeignMessageExtension]] hasC]);
208 XCTAssertTrue([[message getExtension:[UnittestRoot optionalImportMessageExtension]] hasD]);
210 XCTAssertTrue([message hasExtension:[UnittestRoot optionalNestedEnumExtension]]);
211 XCTAssertTrue([message hasExtension:[UnittestRoot optionalForeignEnumExtension]]);
212 XCTAssertTrue([message hasExtension:[UnittestRoot optionalImportEnumExtension]]);
214 XCTAssertTrue([message hasExtension:[UnittestRoot optionalStringPieceExtension]]);
215 XCTAssertTrue([message hasExtension:[UnittestRoot optionalCordExtension]]);
217 XCTAssertTrue([message hasExtension:[UnittestRoot defaultInt32Extension]]);
218 XCTAssertTrue([message hasExtension:[UnittestRoot defaultInt64Extension]]);
219 XCTAssertTrue([message hasExtension:[UnittestRoot defaultUint32Extension]]);
220 XCTAssertTrue([message hasExtension:[UnittestRoot defaultUint64Extension]]);
221 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSint32Extension]]);
222 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSint64Extension]]);
223 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFixed32Extension]]);
224 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFixed64Extension]]);
225 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSfixed32Extension]]);
226 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSfixed64Extension]]);
227 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFloatExtension]]);
228 XCTAssertTrue([message hasExtension:[UnittestRoot defaultDoubleExtension]]);
229 XCTAssertTrue([message hasExtension:[UnittestRoot defaultBoolExtension]]);
230 XCTAssertTrue([message hasExtension:[UnittestRoot defaultStringExtension]]);
231 XCTAssertTrue([message hasExtension:[UnittestRoot defaultBytesExtension]]);
233 XCTAssertTrue([message hasExtension:[UnittestRoot defaultNestedEnumExtension]]);
234 XCTAssertTrue([message hasExtension:[UnittestRoot defaultForeignEnumExtension]]);
235 XCTAssertTrue([message hasExtension:[UnittestRoot defaultImportEnumExtension]]);
237 XCTAssertTrue([message hasExtension:[UnittestRoot defaultStringPieceExtension]]);
238 XCTAssertTrue([message hasExtension:[UnittestRoot defaultCordExtension]]);
240 XCTAssertEqual(101, [[message getExtension:[UnittestRoot optionalInt32Extension]] intValue]);
241 …XCTAssertEqual(102LL, [[message getExtension:[UnittestRoot optionalInt64Extension]] longLongValue]…
242 …XCTAssertEqual(103U, [[message getExtension:[UnittestRoot optionalUint32Extension]] unsignedIntVal…
243 …XCTAssertEqual(104ULL, [[message getExtension:[UnittestRoot optionalUint64Extension]] unsignedLong…
244 XCTAssertEqual(105, [[message getExtension:[UnittestRoot optionalSint32Extension]] intValue]);
245 …XCTAssertEqual(106LL, [[message getExtension:[UnittestRoot optionalSint64Extension]] longLongValue…
246 …XCTAssertEqual(107U, [[message getExtension:[UnittestRoot optionalFixed32Extension]] unsignedIntVa…
247 …XCTAssertEqual(108ULL, [[message getExtension:[UnittestRoot optionalFixed64Extension]] unsignedLon…
248 XCTAssertEqual(109, [[message getExtension:[UnittestRoot optionalSfixed32Extension]] intValue]);
249 …XCTAssertEqual(110LL, [[message getExtension:[UnittestRoot optionalSfixed64Extension]] longLongVal…
250 …XCTAssertEqualWithAccuracy(111.0f, [[message getExtension:[UnittestRoot optionalFloatExtension]] f…
251 …XCTAssertEqualWithAccuracy(112.0, [[message getExtension:[UnittestRoot optionalDoubleExtension]] d…
252 XCTAssertTrue([[message getExtension:[UnittestRoot optionalBoolExtension]] boolValue]);
253 XCTAssertEqualObjects(@"115", [message getExtension:[UnittestRoot optionalStringExtension]]);
254 …XCTAssertEqualObjects([NSData gpbtu_dataWithEmbeddedNulls], [message getExtension:[UnittestRoot op…
256 …XCTAssertEqual(117, [(TestAllTypes_OptionalGroup*)[message getExtension:[UnittestRoot optionalGrou…
257 …XCTAssertEqual(118, [(TestAllTypes_NestedMessage*)[message getExtension:[UnittestRoot optionalNest…
258 XCTAssertEqual(119, [[message getExtension:[UnittestRoot optionalForeignMessageExtension]] c]);
259 XCTAssertEqual(120, [[message getExtension:[UnittestRoot optionalImportMessageExtension]] d]);
261 …XCTAssertEqual(TestAllTypes_NestedEnum_Baz, [[message getExtension:[UnittestRoot optionalNestedEnu…
262 …XCTAssertEqual(ForeignEnum_ForeignBaz, [[message getExtension:[UnittestRoot optionalForeignEnumExt…
263 …XCTAssertEqual(ImportEnum_ImportBaz, [[message getExtension:[UnittestRoot optionalImportEnumExtens…
265 XCTAssertEqualObjects(@"124", [message getExtension:[UnittestRoot optionalStringPieceExtension]]);
266 XCTAssertEqualObjects(@"125", [message getExtension:[UnittestRoot optionalCordExtension]]);
270 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedInt32Extension]] count]);
271 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedInt64Extension]] count]);
272 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedUint32Extension]] count]);
273 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedUint64Extension]] count]);
274 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSint32Extension]] count]);
275 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSint64Extension]] count]);
276 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFixed32Extension]] count]);
277 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFixed64Extension]] count]);
278 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSfixed32Extension]] count]);
279 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSfixed64Extension]] count]);
280 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFloatExtension]] count]);
281 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedDoubleExtension]] count]);
282 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedBoolExtension]] count]);
283 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedStringExtension]] count]);
284 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedBytesExtension]] count]);
286 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedGroupExtension]] count]);
287 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedNestedMessageExtension]] count]…
288 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedForeignMessageExtension]] count…
289 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedImportMessageExtension]] count]…
290 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedNestedEnumExtension]] count]);
291 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedForeignEnumExtension]] count]);
292 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedImportEnumExtension]] count]);
294 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedStringPieceExtension]] count]);
295 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedCordExtension]] count]);
298 id extension = [message getExtension:[UnittestRoot repeatedInt32Extension]];
300 extension = [message getExtension:[UnittestRoot repeatedInt64Extension]];
302 extension = [message getExtension:[UnittestRoot repeatedUint32Extension]];
304 extension = [message getExtension:[UnittestRoot repeatedUint64Extension]];
306 extension = [message getExtension:[UnittestRoot repeatedSint32Extension]];
308 extension = [message getExtension:[UnittestRoot repeatedSint64Extension]];
310 extension = [message getExtension:[UnittestRoot repeatedFixed32Extension]];
312 extension = [message getExtension:[UnittestRoot repeatedFixed64Extension]];
314 extension = [message getExtension:[UnittestRoot repeatedSfixed32Extension]];
316 extension = [message getExtension:[UnittestRoot repeatedSfixed64Extension]];
318 extension = [message getExtension:[UnittestRoot repeatedFloatExtension]];
320 extension = [message getExtension:[UnittestRoot repeatedDoubleExtension]];
322 extension = [message getExtension:[UnittestRoot repeatedBoolExtension]];
326 extension = [message getExtension:[UnittestRoot repeatedStringExtension]];
331 extension = [message getExtension:[UnittestRoot repeatedBytesExtension]];
335 extension = [message getExtension:[UnittestRoot repeatedGroupExtension]];
337 extension = [message getExtension:[UnittestRoot repeatedNestedMessageExtension]];
339 extension = [message getExtension:[UnittestRoot repeatedForeignMessageExtension]];
341 extension = [message getExtension:[UnittestRoot repeatedImportMessageExtension]];
344 extension = [message getExtension:[UnittestRoot repeatedNestedEnumExtension]];
346 extension = [message getExtension:[UnittestRoot repeatedForeignEnumExtension]];
348 extension = [message getExtension:[UnittestRoot repeatedImportEnumExtension]];
352 extension = [message getExtension:[UnittestRoot repeatedStringPieceExtension]];
357 extension = [message getExtension:[UnittestRoot repeatedCordExtension]];
364 XCTAssertTrue([message hasExtension:[UnittestRoot defaultInt32Extension]]);
365 XCTAssertTrue([message hasExtension:[UnittestRoot defaultInt64Extension]]);
366 XCTAssertTrue([message hasExtension:[UnittestRoot defaultUint32Extension]]);
367 XCTAssertTrue([message hasExtension:[UnittestRoot defaultUint64Extension]]);
368 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSint32Extension]]);
369 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSint64Extension]]);
370 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFixed32Extension]]);
371 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFixed64Extension]]);
372 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSfixed32Extension]]);
373 XCTAssertTrue([message hasExtension:[UnittestRoot defaultSfixed64Extension]]);
374 XCTAssertTrue([message hasExtension:[UnittestRoot defaultFloatExtension]]);
375 XCTAssertTrue([message hasExtension:[UnittestRoot defaultDoubleExtension]]);
376 XCTAssertTrue([message hasExtension:[UnittestRoot defaultBoolExtension]]);
377 XCTAssertTrue([message hasExtension:[UnittestRoot defaultStringExtension]]);
378 XCTAssertTrue([message hasExtension:[UnittestRoot defaultBytesExtension]]);
380 XCTAssertTrue([message hasExtension:[UnittestRoot defaultNestedEnumExtension]]);
381 XCTAssertTrue([message hasExtension:[UnittestRoot defaultForeignEnumExtension]]);
382 XCTAssertTrue([message hasExtension:[UnittestRoot defaultImportEnumExtension]]);
384 XCTAssertTrue([message hasExtension:[UnittestRoot defaultStringPieceExtension]]);
385 XCTAssertTrue([message hasExtension:[UnittestRoot defaultCordExtension]]);
387 XCTAssertEqual(401, [[message getExtension:[UnittestRoot defaultInt32Extension]] intValue]);
388 …XCTAssertEqual(402LL, [[message getExtension:[UnittestRoot defaultInt64Extension]] longLongValue]);
389 …XCTAssertEqual(403U, [[message getExtension:[UnittestRoot defaultUint32Extension]] unsignedIntValu…
390 …XCTAssertEqual(404ULL, [[message getExtension:[UnittestRoot defaultUint64Extension]] unsignedLongL…
391 XCTAssertEqual(405, [[message getExtension:[UnittestRoot defaultSint32Extension]] intValue]);
392 …XCTAssertEqual(406LL, [[message getExtension:[UnittestRoot defaultSint64Extension]] longLongValue]…
393 …XCTAssertEqual(407U, [[message getExtension:[UnittestRoot defaultFixed32Extension]] unsignedIntVal…
394 …XCTAssertEqual(408ULL, [[message getExtension:[UnittestRoot defaultFixed64Extension]] unsignedLong…
395 XCTAssertEqual(409, [[message getExtension:[UnittestRoot defaultSfixed32Extension]] intValue]);
396 …XCTAssertEqual(410LL,[[message getExtension:[UnittestRoot defaultSfixed64Extension]] longLongValue…
397 …XCTAssertEqualWithAccuracy(411.0f, [[message getExtension:[UnittestRoot defaultFloatExtension]] fl…
398 …XCTAssertEqualWithAccuracy(412.0, [[message getExtension:[UnittestRoot defaultDoubleExtension]] do…
399 XCTAssertFalse([[message getExtension:[UnittestRoot defaultBoolExtension]] boolValue]);
400 XCTAssertEqualObjects(@"415", [message getExtension:[UnittestRoot defaultStringExtension]]);
401 …XCTAssertEqualObjects([NSData gpbtu_dataWithUint32:416], [message getExtension:[UnittestRoot defau…
403 …XCTAssertEqual(TestAllTypes_NestedEnum_Foo, [[message getExtension:[UnittestRoot defaultNestedEnum…
404 …XCTAssertEqual(ForeignEnum_ForeignFoo, [[message getExtension:[UnittestRoot defaultForeignEnumExte…
405 …XCTAssertEqual(ImportEnum_ImportFoo, [[message getExtension:[UnittestRoot defaultImportEnumExtensi…
407 XCTAssertEqualObjects(@"424", [message getExtension:[UnittestRoot defaultStringPieceExtension]]);
408 XCTAssertEqualObjects(@"425", [message getExtension:[UnittestRoot defaultCordExtension]]);
411 - (void)assertRepeatedExtensionsModified:(TestAllExtensions *)message
416 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedInt32Extension]] count]);
417 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedInt64Extension]] count]);
418 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedUint32Extension]] count]);
419 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedUint64Extension]] count]);
420 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSint32Extension]] count]);
421 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSint64Extension]] count]);
422 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFixed32Extension]] count]);
423 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFixed64Extension]] count]);
424 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSfixed32Extension]] count]);
425 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedSfixed64Extension]] count]);
426 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedFloatExtension]] count]);
427 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedDoubleExtension]] count]);
428 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedBoolExtension]] count]);
429 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedStringExtension]] count]);
430 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedBytesExtension]] count]);
432 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedGroupExtension]] count]);
433 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedNestedMessageExtension]] count]…
434 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedForeignMessageExtension]] count…
435 …XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedImportMessageExtension]] count]…
436 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedNestedEnumExtension]] count]);
437 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedForeignEnumExtension]] count]);
438 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedImportEnumExtension]] count]);
440 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedStringPieceExtension]] count]);
441 XCTAssertEqual(count, [[message getExtension:[UnittestRoot repeatedCordExtension]] count]);
443 XCTAssertEqual(201,[[message getExtension:[UnittestRoot repeatedInt32Extension]][0] intValue]);
444 …XCTAssertEqual(202LL, [[message getExtension:[UnittestRoot repeatedInt64Extension]][0] longLongVal…
445 …XCTAssertEqual(203U, [[message getExtension:[UnittestRoot repeatedUint32Extension]][0] unsignedInt…
446 …XCTAssertEqual(204ULL, [[message getExtension:[UnittestRoot repeatedUint64Extension]][0] unsignedL…
447 XCTAssertEqual(205, [[message getExtension:[UnittestRoot repeatedSint32Extension]][0] intValue]);
448 …XCTAssertEqual(206LL, [[message getExtension:[UnittestRoot repeatedSint64Extension]][0] longLongVa…
449 …XCTAssertEqual(207U, [[message getExtension:[UnittestRoot repeatedFixed32Extension]][0] unsignedIn…
450 …XCTAssertEqual(208ULL, [[message getExtension:[UnittestRoot repeatedFixed64Extension]][0] unsigned…
451 …XCTAssertEqual(209, [[message getExtension:[UnittestRoot repeatedSfixed32Extension]][0] intValue]);
452 …XCTAssertEqual(210LL, [[message getExtension:[UnittestRoot repeatedSfixed64Extension]][0] longLong…
453 …XCTAssertEqualWithAccuracy(211.0f, [[message getExtension:[UnittestRoot repeatedFloatExtension]][0…
454 …XCTAssertEqualWithAccuracy(212.0, [[message getExtension:[UnittestRoot repeatedDoubleExtension]][0…
455 XCTAssertFalse([[message getExtension:[UnittestRoot repeatedBoolExtension]][0] boolValue]);
456 XCTAssertEqualObjects(@"215", [message getExtension:[UnittestRoot repeatedStringExtension]][0]);
457 …XCTAssertEqualObjects([NSData gpbtu_dataWithUint32:216], [message getExtension:[UnittestRoot repea…
459 …XCTAssertEqual(217, [(TestAllTypes_OptionalGroup*)[message getExtension:[UnittestRoot repeatedGrou…
460 …XCTAssertEqual(218, [(TestAllTypes_NestedMessage*)[message getExtension:[UnittestRoot repeatedNest…
461 XCTAssertEqual(219, [[message getExtension:[UnittestRoot repeatedForeignMessageExtension]][0] c]);
462 XCTAssertEqual(220, [[message getExtension:[UnittestRoot repeatedImportMessageExtension]][0] d]);
465 [[message getExtension:[UnittestRoot repeatedNestedEnumExtension]][0] intValue]);
467 [[message getExtension:[UnittestRoot repeatedForeignEnumExtension]][0] intValue]);
469 [[message getExtension:[UnittestRoot repeatedImportEnumExtension]][0] intValue]);
471 …XCTAssertEqualObjects(@"224", [message getExtension:[UnittestRoot repeatedStringPieceExtension]][0…
472 XCTAssertEqualObjects(@"225", [message getExtension:[UnittestRoot repeatedCordExtension]][0]);
475 XCTAssertEqual(501, [[message getExtension:[UnittestRoot repeatedInt32Extension]][1] intValue]);
476 …XCTAssertEqual(502LL, [[message getExtension:[UnittestRoot repeatedInt64Extension]][1] longLongVal…
477 …XCTAssertEqual(503U, [[message getExtension:[UnittestRoot repeatedUint32Extension]][1] unsignedInt…
478 …XCTAssertEqual(504ULL, [[message getExtension:[UnittestRoot repeatedUint64Extension]][1] unsignedL…
479 XCTAssertEqual(505, [[message getExtension:[UnittestRoot repeatedSint32Extension]][1] intValue]);
480 …XCTAssertEqual(506LL, [[message getExtension:[UnittestRoot repeatedSint64Extension]][1] longLongVa…
481 …XCTAssertEqual(507U, [[message getExtension:[UnittestRoot repeatedFixed32Extension]][1] unsignedIn…
482 …XCTAssertEqual(508ULL, [[message getExtension:[UnittestRoot repeatedFixed64Extension]][1] unsigned…
483 …XCTAssertEqual(509, [[message getExtension:[UnittestRoot repeatedSfixed32Extension]][1] intValue]);
484 …XCTAssertEqual(510LL, [[message getExtension:[UnittestRoot repeatedSfixed64Extension]][1] longLong…
485 …XCTAssertEqualWithAccuracy(511.0f, [[message getExtension:[UnittestRoot repeatedFloatExtension]][1…
486 …XCTAssertEqualWithAccuracy(512.0, [[message getExtension:[UnittestRoot repeatedDoubleExtension]][1…
487 XCTAssertTrue([[message getExtension:[UnittestRoot repeatedBoolExtension]][1] boolValue]);
488 XCTAssertEqualObjects(@"515", [message getExtension:[UnittestRoot repeatedStringExtension]][1]);
489 …XCTAssertEqualObjects([NSData gpbtu_dataWithUint32:516], [message getExtension:[UnittestRoot repea…
491 …XCTAssertEqual(517, [(TestAllTypes_OptionalGroup*)[message getExtension:[UnittestRoot repeatedGrou…
492 …XCTAssertEqual(518, [(TestAllTypes_NestedMessage*)[message getExtension:[UnittestRoot repeatedNest…
493 XCTAssertEqual(519, [[message getExtension:[UnittestRoot repeatedForeignMessageExtension]][1] c]);
494 XCTAssertEqual(520, [[message getExtension:[UnittestRoot repeatedImportMessageExtension]][1] d]);
497 [[message getExtension:[UnittestRoot repeatedNestedEnumExtension]][1] intValue]);
499 [[message getExtension:[UnittestRoot repeatedForeignEnumExtension]][1] intValue]);
501 [[message getExtension:[UnittestRoot repeatedImportEnumExtension]][1] intValue]);
503 …XCTAssertEqualObjects(@"524", [message getExtension:[UnittestRoot repeatedStringPieceExtension]][1…
504 XCTAssertEqualObjects(@"525", [message getExtension:[UnittestRoot repeatedCordExtension]][1]);
509 - (void)assertAllFieldsSet:(TestAllTypes *)message
511 XCTAssertTrue(message.hasOptionalInt32);
512 XCTAssertTrue(message.hasOptionalInt64);
513 XCTAssertTrue(message.hasOptionalUint32);
514 XCTAssertTrue(message.hasOptionalUint64);
515 XCTAssertTrue(message.hasOptionalSint32);
516 XCTAssertTrue(message.hasOptionalSint64);
517 XCTAssertTrue(message.hasOptionalFixed32);
518 XCTAssertTrue(message.hasOptionalFixed64);
519 XCTAssertTrue(message.hasOptionalSfixed32);
520 XCTAssertTrue(message.hasOptionalSfixed64);
521 XCTAssertTrue(message.hasOptionalFloat);
522 XCTAssertTrue(message.hasOptionalDouble);
523 XCTAssertTrue(message.hasOptionalBool);
524 XCTAssertTrue(message.hasOptionalString);
525 XCTAssertTrue(message.hasOptionalBytes);
527 XCTAssertTrue(message.hasOptionalGroup);
528 XCTAssertTrue(message.hasOptionalNestedMessage);
529 XCTAssertTrue(message.hasOptionalForeignMessage);
530 XCTAssertTrue(message.hasOptionalImportMessage);
532 XCTAssertTrue(message.optionalGroup.hasA);
533 XCTAssertTrue(message.optionalNestedMessage.hasBb);
534 XCTAssertTrue(message.optionalForeignMessage.hasC);
535 XCTAssertTrue(message.optionalImportMessage.hasD);
537 XCTAssertTrue(message.hasOptionalNestedEnum);
538 XCTAssertTrue(message.hasOptionalForeignEnum);
539 XCTAssertTrue(message.hasOptionalImportEnum);
541 XCTAssertTrue(message.hasOptionalStringPiece);
542 XCTAssertTrue(message.hasOptionalCord);
544 XCTAssertEqual(101, message.optionalInt32);
545 XCTAssertEqual(102LL, message.optionalInt64);
546 XCTAssertEqual(103U, message.optionalUint32);
547 XCTAssertEqual(104ULL, message.optionalUint64);
548 XCTAssertEqual(105, message.optionalSint32);
549 XCTAssertEqual(106LL, message.optionalSint64);
550 XCTAssertEqual(107U, message.optionalFixed32);
551 XCTAssertEqual(108ULL, message.optionalFixed64);
552 XCTAssertEqual(109, message.optionalSfixed32);
553 XCTAssertEqual(110LL, message.optionalSfixed64);
554 XCTAssertEqualWithAccuracy(111.0f, message.optionalFloat, 0.1);
555 XCTAssertEqualWithAccuracy(112.0, message.optionalDouble, 0.1);
556 XCTAssertTrue(message.optionalBool);
557 XCTAssertEqualObjects(@"115", message.optionalString);
559 message.optionalBytes);
561 XCTAssertEqual(117, message.optionalGroup.a);
562 XCTAssertEqual(118, message.optionalNestedMessage.bb);
563 XCTAssertEqual(119, message.optionalForeignMessage.c);
564 XCTAssertEqual(120, message.optionalImportMessage.d);
566 XCTAssertEqual(TestAllTypes_NestedEnum_Baz, message.optionalNestedEnum);
567 XCTAssertEqual(ForeignEnum_ForeignBaz, message.optionalForeignEnum);
568 XCTAssertEqual(ImportEnum_ImportBaz, message.optionalImportEnum);
570 XCTAssertEqualObjects(@"124", message.optionalStringPiece);
571 XCTAssertEqualObjects(@"125", message.optionalCord);
575 XCTAssertEqual(count, message.repeatedInt32Array.count);
576 XCTAssertEqual(count, message.repeatedInt64Array.count);
577 XCTAssertEqual(count, message.repeatedUint32Array.count);
578 XCTAssertEqual(count, message.repeatedUint64Array.count);
579 XCTAssertEqual(count, message.repeatedSint32Array.count);
580 XCTAssertEqual(count, message.repeatedSint64Array.count);
581 XCTAssertEqual(count, message.repeatedFixed32Array.count);
582 XCTAssertEqual(count, message.repeatedFixed64Array.count);
583 XCTAssertEqual(count, message.repeatedSfixed32Array.count);
584 XCTAssertEqual(count, message.repeatedSfixed64Array.count);
585 XCTAssertEqual(count, message.repeatedFloatArray.count);
586 XCTAssertEqual(count, message.repeatedDoubleArray.count);
587 XCTAssertEqual(count, message.repeatedBoolArray.count);
588 XCTAssertEqual(count, message.repeatedStringArray.count);
589 XCTAssertEqual(count, message.repeatedBytesArray.count);
591 XCTAssertEqual(count, message.repeatedGroupArray.count);
592 XCTAssertEqual(count, message.repeatedNestedMessageArray.count);
593 XCTAssertEqual(count, message.repeatedForeignMessageArray.count);
594 XCTAssertEqual(count, message.repeatedImportMessageArray.count);
595 XCTAssertEqual(count, message.repeatedNestedEnumArray.count);
596 XCTAssertEqual(count, message.repeatedForeignEnumArray.count);
597 XCTAssertEqual(count, message.repeatedImportEnumArray.count);
599 XCTAssertEqual(count, message.repeatedStringPieceArray.count);
600 XCTAssertEqual(count, message.repeatedCordArray.count);
602 XCTAssertEqual(count, message.repeatedInt32Array_Count);
603 XCTAssertEqual(count, message.repeatedInt64Array_Count);
604 XCTAssertEqual(count, message.repeatedUint32Array_Count);
605 XCTAssertEqual(count, message.repeatedUint64Array_Count);
606 XCTAssertEqual(count, message.repeatedSint32Array_Count);
607 XCTAssertEqual(count, message.repeatedSint64Array_Count);
608 XCTAssertEqual(count, message.repeatedFixed32Array_Count);
609 XCTAssertEqual(count, message.repeatedFixed64Array_Count);
610 XCTAssertEqual(count, message.repeatedSfixed32Array_Count);
611 XCTAssertEqual(count, message.repeatedSfixed64Array_Count);
612 XCTAssertEqual(count, message.repeatedFloatArray_Count);
613 XCTAssertEqual(count, message.repeatedDoubleArray_Count);
614 XCTAssertEqual(count, message.repeatedBoolArray_Count);
615 XCTAssertEqual(count, message.repeatedStringArray_Count);
616 XCTAssertEqual(count, message.repeatedBytesArray_Count);
618 XCTAssertEqual(count, message.repeatedGroupArray_Count);
619 XCTAssertEqual(count, message.repeatedNestedMessageArray_Count);
620 XCTAssertEqual(count, message.repeatedForeignMessageArray_Count);
621 XCTAssertEqual(count, message.repeatedImportMessageArray_Count);
622 XCTAssertEqual(count, message.repeatedNestedEnumArray_Count);
623 XCTAssertEqual(count, message.repeatedForeignEnumArray_Count);
624 XCTAssertEqual(count, message.repeatedImportEnumArray_Count);
626 XCTAssertEqual(count, message.repeatedStringPieceArray_Count);
627 XCTAssertEqual(count, message.repeatedCordArray_Count);
631 [message.repeatedInt32Array valueAtIndex:i]);
632 XCTAssertEqual(202 + i * 100, [message.repeatedInt64Array valueAtIndex:i]);
633 XCTAssertEqual(203 + i * 100, [message.repeatedUint32Array valueAtIndex:i]);
634 XCTAssertEqual(204 + i * 100, [message.repeatedUint64Array valueAtIndex:i]);
636 [message.repeatedSint32Array valueAtIndex:i]);
637 XCTAssertEqual(206 + i * 100, [message.repeatedSint64Array valueAtIndex:i]);
639 [message.repeatedFixed32Array valueAtIndex:i]);
641 [message.repeatedFixed64Array valueAtIndex:i]);
643 [message.repeatedSfixed32Array valueAtIndex:i]);
645 [message.repeatedSfixed64Array valueAtIndex:i]);
647 211 + i * 100, [message.repeatedFloatArray valueAtIndex:i], 0.1);
649 212 + i * 100, [message.repeatedDoubleArray valueAtIndex:i], 0.1);
651 [message.repeatedBoolArray valueAtIndex:i]);
654 XCTAssertEqualObjects(string, message.repeatedStringArray[i]);
658 XCTAssertEqualObjects(data, message.repeatedBytesArray[i]);
661 …XCTAssertEqual((int)(217 + i * 100), ((TestAllTypes_RepeatedGroup*)message.repeatedGroupArray[i]).…
662 …XCTAssertEqual((int)(218 + i * 100), ((TestAllTypes_NestedMessage*)message.repeatedNestedMessageAr…
663 … XCTAssertEqual((int)(219 + i * 100), ((ForeignMessage*)message.repeatedForeignMessageArray[i]).c);
664 XCTAssertEqual((int)(220 + i * 100), ((ImportMessage*)message.repeatedImportMessageArray[i]).d);
666 …XCTAssertEqual((i % 2) ? TestAllTypes_NestedEnum_Bar : TestAllTypes_NestedEnum_Baz, [message.repea…
667 …XCTAssertEqual((i % 2) ? ForeignEnum_ForeignBar : ForeignEnum_ForeignBaz, [message.repeatedForeign…
668 …XCTAssertEqual((i % 2) ? ImportEnum_ImportBar : ImportEnum_ImportBaz, [message.repeatedImportEnumA…
671 XCTAssertEqualObjects(string, message.repeatedStringPieceArray[i]);
675 XCTAssertEqualObjects(string, message.repeatedCordArray[i]);
681 XCTAssertTrue(message.hasDefaultInt32);
682 XCTAssertTrue(message.hasDefaultInt64);
683 XCTAssertTrue(message.hasDefaultUint32);
684 XCTAssertTrue(message.hasDefaultUint64);
685 XCTAssertTrue(message.hasDefaultSint32);
686 XCTAssertTrue(message.hasDefaultSint64);
687 XCTAssertTrue(message.hasDefaultFixed32);
688 XCTAssertTrue(message.hasDefaultFixed64);
689 XCTAssertTrue(message.hasDefaultSfixed32);
690 XCTAssertTrue(message.hasDefaultSfixed64);
691 XCTAssertTrue(message.hasDefaultFloat);
692 XCTAssertTrue(message.hasDefaultDouble);
693 XCTAssertTrue(message.hasDefaultBool);
694 XCTAssertTrue(message.hasDefaultString);
695 XCTAssertTrue(message.hasDefaultBytes);
697 XCTAssertTrue(message.hasDefaultNestedEnum);
698 XCTAssertTrue(message.hasDefaultForeignEnum);
699 XCTAssertTrue(message.hasDefaultImportEnum);
701 XCTAssertTrue(message.hasDefaultStringPiece);
702 XCTAssertTrue(message.hasDefaultCord);
704 XCTAssertEqual(401, message.defaultInt32);
705 XCTAssertEqual(402LL, message.defaultInt64);
706 XCTAssertEqual(403U, message.defaultUint32);
707 XCTAssertEqual(404ULL, message.defaultUint64);
708 XCTAssertEqual(405, message.defaultSint32);
709 XCTAssertEqual(406LL, message.defaultSint64);
710 XCTAssertEqual(407U, message.defaultFixed32);
711 XCTAssertEqual(408ULL, message.defaultFixed64);
712 XCTAssertEqual(409, message.defaultSfixed32);
713 XCTAssertEqual(410LL, message.defaultSfixed64);
714 XCTAssertEqualWithAccuracy(411.0f, message.defaultFloat, 0.1);
715 XCTAssertEqualWithAccuracy(412.0, message.defaultDouble, 0.1);
716 XCTAssertFalse(message.defaultBool);
717 XCTAssertEqualObjects(@"415", message.defaultString);
719 message.defaultBytes);
721 XCTAssertEqual(TestAllTypes_NestedEnum_Foo, message.defaultNestedEnum);
722 XCTAssertEqual(ForeignEnum_ForeignFoo, message.defaultForeignEnum);
723 XCTAssertEqual(ImportEnum_ImportFoo, message.defaultImportEnum);
725 XCTAssertEqualObjects(@"424", message.defaultStringPiece);
726 XCTAssertEqualObjects(@"425", message.defaultCord);
729 - (void)setAllFields:(TestAllTypes *)message repeatedCount:(uint32_t)count {
730 [message setOptionalInt32:101];
731 [message setOptionalInt64:102];
732 [message setOptionalUint32:103];
733 [message setOptionalUint64:104];
734 [message setOptionalSint32:105];
735 [message setOptionalSint64:106];
736 [message setOptionalFixed32:107];
737 [message setOptionalFixed64:108];
738 [message setOptionalSfixed32:109];
739 [message setOptionalSfixed64:110];
740 [message setOptionalFloat:111];
741 [message setOptionalDouble:112];
742 [message setOptionalBool:YES];
743 [message setOptionalString:@"115"];
744 [message setOptionalBytes:[NSData gpbtu_dataWithEmbeddedNulls]];
746 TestAllTypes_OptionalGroup *allTypes = [TestAllTypes_OptionalGroup message];
748 [message setOptionalGroup:allTypes];
750 [TestAllTypes_NestedMessage message];
752 [message setOptionalNestedMessage:nestedMessage];
753 ForeignMessage *foreignMessage = [ForeignMessage message];
755 [message setOptionalForeignMessage:foreignMessage];
756 ImportMessage *importMessage = [ImportMessage message];
758 [message setOptionalImportMessage:importMessage];
760 [message setOptionalNestedEnum:TestAllTypes_NestedEnum_Baz];
761 [message setOptionalForeignEnum:ForeignEnum_ForeignBaz];
762 [message setOptionalImportEnum:ImportEnum_ImportBaz];
764 [message setOptionalStringPiece:@"124"];
765 [message setOptionalCord:@"125"];
770 [message.repeatedInt32Array addValue:201 + i * 100];
771 [message.repeatedInt64Array addValue:202 + i * 100];
772 [message.repeatedUint32Array addValue:203 + i * 100];
773 [message.repeatedUint64Array addValue:204 + i * 100];
774 [message.repeatedSint32Array addValue:205 + i * 100];
775 [message.repeatedSint64Array addValue:206 + i * 100];
776 [message.repeatedFixed32Array addValue:207 + i * 100];
777 [message.repeatedFixed64Array addValue:208 + i * 100];
778 [message.repeatedSfixed32Array addValue:209 + i * 100];
779 [message.repeatedSfixed64Array addValue:210 + i * 100];
780 [message.repeatedFloatArray addValue:211 + i * 100];
781 [message.repeatedDoubleArray addValue:212 + i * 100];
782 [message.repeatedBoolArray addValue:(i % 2)];
784 [message.repeatedStringArray addObject:string];
788 [message.repeatedBytesArray addObject:data];
794 [message.repeatedGroupArray addObject:testAll];
799 [message.repeatedNestedMessageArray addObject:nestedMessage];
804 [message.repeatedForeignMessageArray addObject:foreignMessage];
809 [message.repeatedImportMessageArray addObject:importMessage];
812 …[message.repeatedNestedEnumArray addValue:(i % 2) ? TestAllTypes_NestedEnum_Bar : TestAllTypes_Nes…
814 …[message.repeatedForeignEnumArray addValue:(i % 2) ? ForeignEnum_ForeignBar : ForeignEnum_ForeignB…
815 … [message.repeatedImportEnumArray addValue:(i % 2) ? ImportEnum_ImportBar : ImportEnum_ImportBaz];
818 [message.repeatedStringPieceArray addObject:string];
822 [message.repeatedCordArray addObject:string];
827 message.defaultInt32 = 401;
828 message.defaultInt64 = 402;
829 message.defaultUint32 = 403;
830 message.defaultUint64 = 404;
831 message.defaultSint32 = 405;
832 message.defaultSint64 = 406;
833 message.defaultFixed32 = 407;
834 message.defaultFixed64 = 408;
835 message.defaultSfixed32 = 409;
836 message.defaultSfixed64 = 410;
837 message.defaultFloat = 411;
838 message.defaultDouble = 412;
839 message.defaultBool = NO;
840 message.defaultString = @"415";
841 message.defaultBytes = [NSData gpbtu_dataWithUint32:416];
843 message.defaultNestedEnum = TestAllTypes_NestedEnum_Foo;
844 message.defaultForeignEnum = ForeignEnum_ForeignFoo;
845 message.defaultImportEnum = ImportEnum_ImportFoo;
847 message.defaultStringPiece = @"424";
848 message.defaultCord = @"425";
851 - (void)clearAllFields:(TestAllTypes *)message {
852 message.hasOptionalInt32 = NO;
853 message.hasOptionalInt64 = NO;
854 message.hasOptionalUint32 = NO;
855 message.hasOptionalUint64 = NO;
856 message.hasOptionalSint32 = NO;
857 message.hasOptionalSint64 = NO;
858 message.hasOptionalFixed32 = NO;
859 message.hasOptionalFixed64 = NO;
860 message.hasOptionalSfixed32 = NO;
861 message.hasOptionalSfixed64 = NO;
862 message.hasOptionalFloat = NO;
863 message.hasOptionalDouble = NO;
864 message.hasOptionalBool = NO;
865 message.hasOptionalString = NO;
866 message.hasOptionalBytes = NO;
868 message.hasOptionalGroup = NO;
869 message.hasOptionalNestedMessage = NO;
870 message.hasOptionalForeignMessage = NO;
871 message.hasOptionalImportMessage = NO;
873 message.hasOptionalNestedEnum = NO;
874 message.hasOptionalForeignEnum = NO;
875 message.hasOptionalImportEnum = NO;
877 message.hasOptionalStringPiece = NO;
878 message.hasOptionalCord = NO;
882 [message.repeatedInt32Array removeAll];
883 [message.repeatedInt64Array removeAll];
884 [message.repeatedUint32Array removeAll];
885 [message.repeatedUint64Array removeAll];
886 [message.repeatedSint32Array removeAll];
887 [message.repeatedSint64Array removeAll];
888 [message.repeatedFixed32Array removeAll];
889 [message.repeatedFixed64Array removeAll];
890 [message.repeatedSfixed32Array removeAll];
891 [message.repeatedSfixed64Array removeAll];
892 [message.repeatedFloatArray removeAll];
893 [message.repeatedDoubleArray removeAll];
894 [message.repeatedBoolArray removeAll];
895 [message.repeatedStringArray removeAllObjects];
896 [message.repeatedBytesArray removeAllObjects];
898 [message.repeatedGroupArray removeAllObjects];
899 [message.repeatedNestedMessageArray removeAllObjects];
900 [message.repeatedForeignMessageArray removeAllObjects];
901 [message.repeatedImportMessageArray removeAllObjects];
903 [message.repeatedNestedEnumArray removeAll];
904 [message.repeatedForeignEnumArray removeAll];
905 [message.repeatedImportEnumArray removeAll];
907 [message.repeatedStringPieceArray removeAllObjects];
908 [message.repeatedCordArray removeAllObjects];
912 message.hasDefaultInt32 = NO;
913 message.hasDefaultInt64 = NO;
914 message.hasDefaultUint32 = NO;
915 message.hasDefaultUint64 = NO;
916 message.hasDefaultSint32 = NO;
917 message.hasDefaultSint64 = NO;
918 message.hasDefaultFixed32 = NO;
919 message.hasDefaultFixed64 = NO;
920 message.hasDefaultSfixed32 = NO;
921 message.hasDefaultSfixed64 = NO;
922 message.hasDefaultFloat = NO;
923 message.hasDefaultDouble = NO;
924 message.hasDefaultBool = NO;
925 message.hasDefaultString = NO;
926 message.hasDefaultBytes = NO;
928 message.hasDefaultNestedEnum = NO;
929 message.hasDefaultForeignEnum = NO;
930 message.hasDefaultImportEnum = NO;
932 message.hasDefaultStringPiece = NO;
933 message.hasDefaultCord = NO;
936 - (void)setAllExtensions:(TestAllExtensions *)message
938 [message setExtension:[UnittestRoot optionalInt32Extension] value:@101];
939 [message setExtension:[UnittestRoot optionalInt64Extension] value:@102L];
940 [message setExtension:[UnittestRoot optionalUint32Extension] value:@103];
941 [message setExtension:[UnittestRoot optionalUint64Extension] value:@104L];
942 [message setExtension:[UnittestRoot optionalSint32Extension] value:@105];
943 [message setExtension:[UnittestRoot optionalSint64Extension] value:@106L];
944 [message setExtension:[UnittestRoot optionalFixed32Extension] value:@107];
945 [message setExtension:[UnittestRoot optionalFixed64Extension] value:@108L];
946 [message setExtension:[UnittestRoot optionalSfixed32Extension] value:@109];
947 [message setExtension:[UnittestRoot optionalSfixed64Extension] value:@110L];
948 [message setExtension:[UnittestRoot optionalFloatExtension] value:@111.0f];
949 [message setExtension:[UnittestRoot optionalDoubleExtension] value:@112.0];
950 [message setExtension:[UnittestRoot optionalBoolExtension] value:@YES];
951 [message setExtension:[UnittestRoot optionalStringExtension] value:@"115"];
952 [message setExtension:[UnittestRoot optionalBytesExtension]
955 OptionalGroup_extension *optionalGroup = [OptionalGroup_extension message];
957 [message setExtension:[UnittestRoot optionalGroupExtension]
960 [TestAllTypes_NestedMessage message];
962 [message setExtension:[UnittestRoot optionalNestedMessageExtension]
964 ForeignMessage *foreignMessage = [ForeignMessage message];
966 [message setExtension:[UnittestRoot optionalForeignMessageExtension]
968 ImportMessage *importMessage = [ImportMessage message];
970 [message setExtension:[UnittestRoot optionalImportMessageExtension]
973 [message setExtension:[UnittestRoot optionalNestedEnumExtension]
975 [message setExtension:[UnittestRoot optionalForeignEnumExtension]
977 [message setExtension:[UnittestRoot optionalImportEnumExtension]
980 [message setExtension:[UnittestRoot optionalStringPieceExtension]
982 [message setExtension:[UnittestRoot optionalCordExtension] value:@"125"];
985 [message addExtension:[UnittestRoot repeatedInt32Extension]
987 [message addExtension:[UnittestRoot repeatedInt64Extension]
989 [message addExtension:[UnittestRoot repeatedUint32Extension]
991 [message addExtension:[UnittestRoot repeatedUint64Extension]
993 [message addExtension:[UnittestRoot repeatedSint32Extension]
995 [message addExtension:[UnittestRoot repeatedSint64Extension]
997 [message addExtension:[UnittestRoot repeatedFixed32Extension]
999 [message addExtension:[UnittestRoot repeatedFixed64Extension]
1001 [message addExtension:[UnittestRoot repeatedSfixed32Extension]
1003 [message addExtension:[UnittestRoot repeatedSfixed64Extension]
1005 [message addExtension:[UnittestRoot repeatedFloatExtension]
1007 [message addExtension:[UnittestRoot repeatedDoubleExtension]
1009 [message addExtension:[UnittestRoot repeatedBoolExtension]
1012 [message addExtension:[UnittestRoot repeatedStringExtension] value:string];
1015 [message addExtension:[UnittestRoot repeatedBytesExtension] value:data];
1021 [message addExtension:[UnittestRoot repeatedGroupExtension]
1026 [message addExtension:[UnittestRoot repeatedNestedMessageExtension]
1031 [message addExtension:[UnittestRoot repeatedForeignMessageExtension]
1036 [message addExtension:[UnittestRoot repeatedImportMessageExtension]
1039 [message addExtension:[UnittestRoot repeatedNestedEnumExtension]
1042 [message addExtension:[UnittestRoot repeatedForeignEnumExtension]
1045 [message
1050 [message addExtension:[UnittestRoot repeatedStringPieceExtension]
1055 [message addExtension:[UnittestRoot repeatedCordExtension] value:string];
1061 [message setExtension:[UnittestRoot defaultInt32Extension] value:@401];
1062 [message setExtension:[UnittestRoot defaultInt64Extension] value:@402L];
1063 [message setExtension:[UnittestRoot defaultUint32Extension] value:@403];
1064 [message setExtension:[UnittestRoot defaultUint64Extension] value:@404L];
1065 [message setExtension:[UnittestRoot defaultSint32Extension] value:@405];
1066 [message setExtension:[UnittestRoot defaultSint64Extension] value:@406L];
1067 [message setExtension:[UnittestRoot defaultFixed32Extension] value:@407];
1068 [message setExtension:[UnittestRoot defaultFixed64Extension] value:@408L];
1069 [message setExtension:[UnittestRoot defaultSfixed32Extension] value:@409];
1070 [message setExtension:[UnittestRoot defaultSfixed64Extension] value:@410L];
1071 [message setExtension:[UnittestRoot defaultFloatExtension] value:@411.0f];
1072 [message setExtension:[UnittestRoot defaultDoubleExtension] value:@412.0];
1073 [message setExtension:[UnittestRoot defaultBoolExtension] value:@NO];
1074 [message setExtension:[UnittestRoot defaultStringExtension] value:@"415"];
1075 [message setExtension:[UnittestRoot defaultBytesExtension]
1078 [message setExtension:[UnittestRoot defaultNestedEnumExtension]
1080 [message setExtension:[UnittestRoot defaultForeignEnumExtension]
1082 [message setExtension:[UnittestRoot defaultImportEnumExtension]
1085 [message setExtension:[UnittestRoot defaultStringPieceExtension]
1087 [message setExtension:[UnittestRoot defaultCordExtension] value:@"425"];
1090 - (void)setAllMapFields:(TestMap *)message numEntries:(uint32_t)count {
1092 [message.mapInt32Int32 setValue:(i + 1) forKey:100 + i * 100];
1093 [message.mapInt64Int64 setValue:(i + 1) forKey:101 + i * 100];
1094 [message.mapUint32Uint32 setValue:(i + 1) forKey:102 + i * 100];
1095 [message.mapUint64Uint64 setValue:(i + 1) forKey:103 + i * 100];
1096 [message.mapSint32Sint32 setValue:(i + 1) forKey:104 + i * 100];
1097 [message.mapSint64Sint64 setValue:(i + 1) forKey:105 + i * 100];
1098 [message.mapFixed32Fixed32 setValue:(i + 1) forKey:106 + i * 100];
1099 [message.mapFixed64Fixed64 setValue:(i + 1) forKey:107 + i * 100];
1100 [message.mapSfixed32Sfixed32 setValue:(i + 1) forKey:108 + i * 100];
1101 [message.mapSfixed64Sfixed64 setValue:(i + 1) forKey:109 + i * 100];
1102 [message.mapInt32Float setValue:(i + 1) forKey:110 + i * 100];
1103 [message.mapInt32Double setValue:(i + 1) forKey:111 + i * 100];
1104 [message.mapBoolBool setValue:((i % 2) == 1) forKey:((i % 2) == 0)];
1108 [message.mapStringString setObject:dataStr forKey:keyStr];
1113 [message.mapInt32Bytes setObject:data forKey:113 + i * 100];
1116 [message.mapInt32Enum
1122 [message.mapInt32ForeignMessage setObject:subMsg forKey:115 + i * 100];
1127 - (void)setAllTestPackedFields:(TestPackedTypes *)message {
1129 [message.packedInt32Array addValue:101];
1130 [message.packedInt64Array addValue:102];
1131 [message.packedUint32Array addValue:103];
1132 [message.packedUint64Array addValue:104];
1133 [message.packedSint32Array addValue:105];
1134 [message.packedSint64Array addValue:106];
1135 [message.packedFixed32Array addValue:107];
1136 [message.packedFixed64Array addValue:108];
1137 [message.packedSfixed32Array addValue:109];
1138 [message.packedSfixed64Array addValue:110];
1139 [message.packedFloatArray addValue:111.f];
1140 [message.packedDoubleArray addValue:112.];
1141 [message.packedBoolArray addValue:YES];
1142 [message.packedEnumArray addValue:ForeignEnum_ForeignBar];
1144 [message.packedInt32Array addValue:201];
1145 [message.packedInt64Array addValue:302];
1146 [message.packedUint32Array addValue:203];
1147 [message.packedUint64Array addValue:204];
1148 [message.packedSint32Array addValue:205];
1149 [message.packedSint64Array addValue:206];
1150 [message.packedFixed32Array addValue:207];
1151 [message.packedFixed64Array addValue:208];
1152 [message.packedSfixed32Array addValue:209];
1153 [message.packedSfixed64Array addValue:210];
1154 [message.packedFloatArray addValue:211.f];
1155 [message.packedDoubleArray addValue:212.];
1156 [message.packedBoolArray addValue:NO];
1157 [message.packedEnumArray addValue:ForeignEnum_ForeignBaz];
1160 - (void)setAllTestUnpackedFields:(TestUnpackedTypes *)message {
1162 [message.unpackedInt32Array addValue:101];
1163 [message.unpackedInt64Array addValue:102];
1164 [message.unpackedUint32Array addValue:103];
1165 [message.unpackedUint64Array addValue:104];
1166 [message.unpackedSint32Array addValue:105];
1167 [message.unpackedSint64Array addValue:106];
1168 [message.unpackedFixed32Array addValue:107];
1169 [message.unpackedFixed64Array addValue:108];
1170 [message.unpackedSfixed32Array addValue:109];
1171 [message.unpackedSfixed64Array addValue:110];
1172 [message.unpackedFloatArray addValue:111.f];
1173 [message.unpackedDoubleArray addValue:112.];
1174 [message.unpackedBoolArray addValue:YES];
1175 [message.unpackedEnumArray addValue:ForeignEnum_ForeignBar];
1177 [message.unpackedInt32Array addValue:201];
1178 [message.unpackedInt64Array addValue:302];
1179 [message.unpackedUint32Array addValue:203];
1180 [message.unpackedUint64Array addValue:204];
1181 [message.unpackedSint32Array addValue:205];
1182 [message.unpackedSint64Array addValue:206];
1183 [message.unpackedFixed32Array addValue:207];
1184 [message.unpackedFixed64Array addValue:208];
1185 [message.unpackedSfixed32Array addValue:209];
1186 [message.unpackedSfixed64Array addValue:210];
1187 [message.unpackedFloatArray addValue:211.f];
1188 [message.unpackedDoubleArray addValue:212.];
1189 [message.unpackedBoolArray addValue:NO];
1190 [message.unpackedEnumArray addValue:ForeignEnum_ForeignBaz];
1198 TestAllTypes *message = [TestAllTypes message];
1199 [self setAllFields:message repeatedCount:count];
1200 return message;
1204 TestAllExtensions *message = [TestAllExtensions message];
1205 [self setAllExtensions:message repeatedCount:count];
1206 return message;
1210 TestPackedTypes *message = [TestPackedTypes message];
1211 [self setPackedFields:message repeatedCount:count];
1212 return message;
1216 TestPackedExtensions *message = [TestPackedExtensions message];
1217 [self setPackedExtensions:message repeatedCount:count];
1218 return message;
1223 - (void)assertClear:(TestAllTypes *)message {
1225 XCTAssertFalse(message.hasOptionalInt32);
1226 XCTAssertFalse(message.hasOptionalInt64);
1227 XCTAssertFalse(message.hasOptionalUint32);
1228 XCTAssertFalse(message.hasOptionalUint64);
1229 XCTAssertFalse(message.hasOptionalSint32);
1230 XCTAssertFalse(message.hasOptionalSint64);
1231 XCTAssertFalse(message.hasOptionalFixed32);
1232 XCTAssertFalse(message.hasOptionalFixed64);
1233 XCTAssertFalse(message.hasOptionalSfixed32);
1234 XCTAssertFalse(message.hasOptionalSfixed64);
1235 XCTAssertFalse(message.hasOptionalFloat);
1236 XCTAssertFalse(message.hasOptionalDouble);
1237 XCTAssertFalse(message.hasOptionalBool);
1238 XCTAssertFalse(message.hasOptionalString);
1239 XCTAssertFalse(message.hasOptionalBytes);
1241 XCTAssertFalse(message.hasOptionalGroup);
1242 XCTAssertFalse(message.hasOptionalNestedMessage);
1243 XCTAssertFalse(message.hasOptionalForeignMessage);
1244 XCTAssertFalse(message.hasOptionalImportMessage);
1246 XCTAssertFalse(message.hasOptionalNestedEnum);
1247 XCTAssertFalse(message.hasOptionalForeignEnum);
1248 XCTAssertFalse(message.hasOptionalImportEnum);
1250 XCTAssertFalse(message.hasOptionalStringPiece);
1251 XCTAssertFalse(message.hasOptionalCord);
1254 XCTAssertEqual(0, message.optionalInt32);
1255 XCTAssertEqual(0LL, message.optionalInt64);
1256 XCTAssertEqual(0U, message.optionalUint32);
1257 XCTAssertEqual(0ULL, message.optionalUint64);
1258 XCTAssertEqual(0, message.optionalSint32);
1259 XCTAssertEqual(0LL, message.optionalSint64);
1260 XCTAssertEqual(0U, message.optionalFixed32);
1261 XCTAssertEqual(0ULL, message.optionalFixed64);
1262 XCTAssertEqual(0, message.optionalSfixed32);
1263 XCTAssertEqual(0LL, message.optionalSfixed64);
1264 XCTAssertEqual(0.0f, message.optionalFloat);
1265 XCTAssertEqual(0.0, message.optionalDouble);
1266 XCTAssertFalse(message.optionalBool);
1267 XCTAssertEqualObjects(message.optionalString, @"");
1268 XCTAssertEqualObjects(message.optionalBytes, GPBEmptyNSData());
1271 XCTAssertFalse(message.hasOptionalGroup);
1272 XCTAssertFalse(message.hasOptionalNestedMessage);
1273 XCTAssertFalse(message.hasOptionalForeignMessage);
1274 XCTAssertFalse(message.hasOptionalImportMessage);
1277 XCTAssertEqual(TestAllTypes_NestedEnum_Foo, message.optionalNestedEnum);
1278 XCTAssertEqual(ForeignEnum_ForeignFoo, message.optionalForeignEnum);
1279 XCTAssertEqual(ImportEnum_ImportFoo, message.optionalImportEnum);
1281 XCTAssertEqualObjects(message.optionalStringPiece, @"");
1282 XCTAssertEqualObjects(message.optionalCord, @"");
1286 XCTAssertEqual(0U, message.repeatedInt32Array.count);
1287 XCTAssertEqual(0U, message.repeatedInt64Array.count);
1288 XCTAssertEqual(0U, message.repeatedUint32Array.count);
1289 XCTAssertEqual(0U, message.repeatedUint64Array.count);
1290 XCTAssertEqual(0U, message.repeatedSint32Array.count);
1291 XCTAssertEqual(0U, message.repeatedSint64Array.count);
1292 XCTAssertEqual(0U, message.repeatedFixed32Array.count);
1293 XCTAssertEqual(0U, message.repeatedFixed64Array.count);
1294 XCTAssertEqual(0U, message.repeatedSfixed32Array.count);
1295 XCTAssertEqual(0U, message.repeatedSfixed64Array.count);
1296 XCTAssertEqual(0U, message.repeatedFloatArray.count);
1297 XCTAssertEqual(0U, message.repeatedDoubleArray.count);
1298 XCTAssertEqual(0U, message.repeatedBoolArray.count);
1299 XCTAssertEqual(0U, message.repeatedStringArray.count);
1300 XCTAssertEqual(0U, message.repeatedBytesArray.count);
1302 XCTAssertEqual(0U, message.repeatedGroupArray.count);
1303 XCTAssertEqual(0U, message.repeatedNestedMessageArray.count);
1304 XCTAssertEqual(0U, message.repeatedForeignMessageArray.count);
1305 XCTAssertEqual(0U, message.repeatedImportMessageArray.count);
1306 XCTAssertEqual(0U, message.repeatedNestedEnumArray.count);
1307 XCTAssertEqual(0U, message.repeatedForeignEnumArray.count);
1308 XCTAssertEqual(0U, message.repeatedImportEnumArray.count);
1310 XCTAssertEqual(0U, message.repeatedStringPieceArray.count);
1311 XCTAssertEqual(0U, message.repeatedCordArray.count);
1313 XCTAssertEqual(0U, message.repeatedInt32Array_Count);
1314 XCTAssertEqual(0U, message.repeatedInt64Array_Count);
1315 XCTAssertEqual(0U, message.repeatedUint32Array_Count);
1316 XCTAssertEqual(0U, message.repeatedUint64Array_Count);
1317 XCTAssertEqual(0U, message.repeatedSint32Array_Count);
1318 XCTAssertEqual(0U, message.repeatedSint64Array_Count);
1319 XCTAssertEqual(0U, message.repeatedFixed32Array_Count);
1320 XCTAssertEqual(0U, message.repeatedFixed64Array_Count);
1321 XCTAssertEqual(0U, message.repeatedSfixed32Array_Count);
1322 XCTAssertEqual(0U, message.repeatedSfixed64Array_Count);
1323 XCTAssertEqual(0U, message.repeatedFloatArray_Count);
1324 XCTAssertEqual(0U, message.repeatedDoubleArray_Count);
1325 XCTAssertEqual(0U, message.repeatedBoolArray_Count);
1326 XCTAssertEqual(0U, message.repeatedStringArray_Count);
1327 XCTAssertEqual(0U, message.repeatedBytesArray_Count);
1329 XCTAssertEqual(0U, message.repeatedGroupArray_Count);
1330 XCTAssertEqual(0U, message.repeatedNestedMessageArray_Count);
1331 XCTAssertEqual(0U, message.repeatedForeignMessageArray_Count);
1332 XCTAssertEqual(0U, message.repeatedImportMessageArray_Count);
1333 XCTAssertEqual(0U, message.repeatedNestedEnumArray_Count);
1334 XCTAssertEqual(0U, message.repeatedForeignEnumArray_Count);
1335 XCTAssertEqual(0U, message.repeatedImportEnumArray_Count);
1337 XCTAssertEqual(0U, message.repeatedStringPieceArray_Count);
1338 XCTAssertEqual(0U, message.repeatedCordArray_Count);
1341 XCTAssertFalse(message.hasDefaultInt32);
1342 XCTAssertFalse(message.hasDefaultInt64);
1343 XCTAssertFalse(message.hasDefaultUint32);
1344 XCTAssertFalse(message.hasDefaultUint64);
1345 XCTAssertFalse(message.hasDefaultSint32);
1346 XCTAssertFalse(message.hasDefaultSint64);
1347 XCTAssertFalse(message.hasDefaultFixed32);
1348 XCTAssertFalse(message.hasDefaultFixed64);
1349 XCTAssertFalse(message.hasDefaultSfixed32);
1350 XCTAssertFalse(message.hasDefaultSfixed64);
1351 XCTAssertFalse(message.hasDefaultFloat);
1352 XCTAssertFalse(message.hasDefaultDouble);
1353 XCTAssertFalse(message.hasDefaultBool);
1354 XCTAssertFalse(message.hasDefaultString);
1355 XCTAssertFalse(message.hasDefaultBytes);
1357 XCTAssertFalse(message.hasDefaultNestedEnum);
1358 XCTAssertFalse(message.hasDefaultForeignEnum);
1359 XCTAssertFalse(message.hasDefaultImportEnum);
1361 XCTAssertFalse(message.hasDefaultStringPiece);
1362 XCTAssertFalse(message.hasDefaultCord);
1365 XCTAssertEqual(41, message.defaultInt32);
1366 XCTAssertEqual(42LL, message.defaultInt64);
1367 XCTAssertEqual(43U, message.defaultUint32);
1368 XCTAssertEqual(44ULL, message.defaultUint64);
1369 XCTAssertEqual(-45, message.defaultSint32);
1370 XCTAssertEqual(46LL, message.defaultSint64);
1371 XCTAssertEqual(47U, message.defaultFixed32);
1372 XCTAssertEqual(48ULL, message.defaultFixed64);
1373 XCTAssertEqual(49, message.defaultSfixed32);
1374 XCTAssertEqual(-50LL, message.defaultSfixed64);
1375 XCTAssertEqualWithAccuracy(51.5f, message.defaultFloat, 0.1);
1376 XCTAssertEqualWithAccuracy(52e3, message.defaultDouble, 0.1);
1377 XCTAssertTrue(message.defaultBool);
1378 XCTAssertEqualObjects(@"hello", message.defaultString);
1380 message.defaultBytes);
1382 XCTAssertEqual(TestAllTypes_NestedEnum_Bar, message.defaultNestedEnum);
1383 XCTAssertEqual(ForeignEnum_ForeignBar, message.defaultForeignEnum);
1384 XCTAssertEqual(ImportEnum_ImportBar, message.defaultImportEnum);
1386 XCTAssertEqualObjects(@"abc", message.defaultStringPiece);
1387 XCTAssertEqualObjects(@"123", message.defaultCord);
1390 - (void)assertExtensionsClear:(TestAllExtensions *)message {
1392 XCTAssertFalse([message hasExtension:[UnittestRoot optionalInt32Extension]]);
1393 XCTAssertFalse([message hasExtension:[UnittestRoot optionalInt64Extension]]);
1394 XCTAssertFalse([message hasExtension:[UnittestRoot optionalUint32Extension]]);
1395 XCTAssertFalse([message hasExtension:[UnittestRoot optionalUint64Extension]]);
1396 XCTAssertFalse([message hasExtension:[UnittestRoot optionalSint32Extension]]);
1397 XCTAssertFalse([message hasExtension:[UnittestRoot optionalSint64Extension]]);
1398 XCTAssertFalse([message hasExtension:[UnittestRoot optionalFixed32Extension]]);
1399 XCTAssertFalse([message hasExtension:[UnittestRoot optionalFixed64Extension]]);
1400 XCTAssertFalse([message hasExtension:[UnittestRoot optionalSfixed32Extension]]);
1401 XCTAssertFalse([message hasExtension:[UnittestRoot optionalSfixed64Extension]]);
1402 XCTAssertFalse([message hasExtension:[UnittestRoot optionalFloatExtension]]);
1403 XCTAssertFalse([message hasExtension:[UnittestRoot optionalDoubleExtension]]);
1404 XCTAssertFalse([message hasExtension:[UnittestRoot optionalBoolExtension]]);
1405 XCTAssertFalse([message hasExtension:[UnittestRoot optionalStringExtension]]);
1406 XCTAssertFalse([message hasExtension:[UnittestRoot optionalBytesExtension]]);
1408 XCTAssertFalse([message hasExtension:[UnittestRoot optionalGroupExtension]]);
1409 XCTAssertFalse([message hasExtension:[UnittestRoot optionalNestedMessageExtension]]);
1410 XCTAssertFalse([message hasExtension:[UnittestRoot optionalForeignMessageExtension]]);
1411 XCTAssertFalse([message hasExtension:[UnittestRoot optionalImportMessageExtension]]);
1413 XCTAssertFalse([message hasExtension:[UnittestRoot optionalNestedEnumExtension]]);
1414 XCTAssertFalse([message hasExtension:[UnittestRoot optionalForeignEnumExtension]]);
1415 XCTAssertFalse([message hasExtension:[UnittestRoot optionalImportEnumExtension]]);
1417 XCTAssertFalse([message hasExtension:[UnittestRoot optionalStringPieceExtension]]);
1418 XCTAssertFalse([message hasExtension:[UnittestRoot optionalCordExtension]]);
1421 XCTAssertEqual(0, [[message getExtension:[UnittestRoot optionalInt32Extension]] intValue]);
1422 XCTAssertEqual(0LL,[[message getExtension:[UnittestRoot optionalInt64Extension]] longLongValue]);
1423 …XCTAssertEqual(0U, [[message getExtension:[UnittestRoot optionalUint32Extension]] unsignedIntValue…
1424 …XCTAssertEqual(0ULL, [[message getExtension:[UnittestRoot optionalUint64Extension]] unsignedLongLo…
1425 XCTAssertEqual(0, [[message getExtension:[UnittestRoot optionalSint32Extension]] intValue]);
1426 …XCTAssertEqual(0LL, [[message getExtension:[UnittestRoot optionalSint64Extension]] longLongValue]);
1427 …XCTAssertEqual(0U, [[message getExtension:[UnittestRoot optionalFixed32Extension]] unsignedIntValu…
1428 …XCTAssertEqual(0ULL, [[message getExtension:[UnittestRoot optionalFixed64Extension]] unsignedLongL…
1429 XCTAssertEqual(0, [[message getExtension:[UnittestRoot optionalSfixed32Extension]] intValue]);
1430 …XCTAssertEqual(0LL, [[message getExtension:[UnittestRoot optionalSfixed64Extension]] longLongValue…
1431 …XCTAssertEqualWithAccuracy(0.0f, [[message getExtension:[UnittestRoot optionalFloatExtension]] flo…
1432 …XCTAssertEqualWithAccuracy(0.0, [[message getExtension:[UnittestRoot optionalDoubleExtension]] dou…
1433 XCTAssertFalse([[message getExtension:[UnittestRoot optionalBoolExtension]] boolValue]);
1434 XCTAssertEqualObjects(@"", [message getExtension:[UnittestRoot optionalStringExtension]]);
1435 …XCTAssertEqualObjects(GPBEmptyNSData(), [message getExtension:[UnittestRoot optionalBytesExtension…
1439 XCTAssertFalse([[message getExtension:[UnittestRoot optionalGroupExtension]] hasA]);
1440 XCTAssertFalse([[message getExtension:[UnittestRoot optionalNestedMessageExtension]] hasBb]);
1441 XCTAssertFalse([[message getExtension:[UnittestRoot optionalForeignMessageExtension]] hasC]);
1442 XCTAssertFalse([[message getExtension:[UnittestRoot optionalImportMessageExtension]] hasD]);
1444 …XCTAssertEqual(0, [(TestAllTypes_OptionalGroup*)[message getExtension:[UnittestRoot optionalGroupE…
1445 …XCTAssertEqual(0, [(TestAllTypes_NestedMessage*)[message getExtension:[UnittestRoot optionalNested…
1446 XCTAssertEqual(0, [[message getExtension:[UnittestRoot optionalForeignMessageExtension]] c]);
1447 XCTAssertEqual(0, [[message getExtension:[UnittestRoot optionalImportMessageExtension]] d]);
1451 [[message getExtension:[UnittestRoot optionalNestedEnumExtension]] intValue]);
1453 [[message getExtension:[UnittestRoot optionalForeignEnumExtension]] intValue]);
1455 [[message getExtension:[UnittestRoot optionalImportEnumExtension]] intValue]);
1457 XCTAssertEqualObjects(@"", [message getExtension:[UnittestRoot optionalStringPieceExtension]]);
1458 XCTAssertEqualObjects(@"", [message getExtension:[UnittestRoot optionalCordExtension]]);
1461 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedInt32Extension]] count]);
1462 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedInt64Extension]] count]);
1463 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedUint32Extension]] count]);
1464 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedUint64Extension]] count]);
1465 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedSint32Extension]] count]);
1466 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedSint64Extension]] count]);
1467 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedFixed32Extension]] count]);
1468 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedFixed64Extension]] count]);
1469 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedSfixed32Extension]] count]);
1470 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedSfixed64Extension]] count]);
1471 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedFloatExtension]] count]);
1472 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedDoubleExtension]] count]);
1473 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedBoolExtension]] count]);
1474 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedStringExtension]] count]);
1475 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedBytesExtension]] count]);
1477 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedGroupExtension]] count]);
1478 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedNestedMessageExtension]] count]);
1479 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedForeignMessageExtension]] count]);
1480 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedImportMessageExtension]] count]);
1481 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedNestedEnumExtension]] count]);
1482 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedForeignEnumExtension]] count]);
1483 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedImportEnumExtension]] count]);
1485 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedStringPieceExtension]] count]);
1486 XCTAssertEqual(0U, [[message getExtension:[UnittestRoot repeatedCordExtension]] count]);
1489 XCTAssertFalse([message hasExtension:[UnittestRoot defaultInt32Extension]]);
1490 XCTAssertFalse([message hasExtension:[UnittestRoot defaultInt64Extension]]);
1491 XCTAssertFalse([message hasExtension:[UnittestRoot defaultUint32Extension]]);
1492 XCTAssertFalse([message hasExtension:[UnittestRoot defaultUint64Extension]]);
1493 XCTAssertFalse([message hasExtension:[UnittestRoot defaultSint32Extension]]);
1494 XCTAssertFalse([message hasExtension:[UnittestRoot defaultSint64Extension]]);
1495 XCTAssertFalse([message hasExtension:[UnittestRoot defaultFixed32Extension]]);
1496 XCTAssertFalse([message hasExtension:[UnittestRoot defaultFixed64Extension]]);
1497 XCTAssertFalse([message hasExtension:[UnittestRoot defaultSfixed32Extension]]);
1498 XCTAssertFalse([message hasExtension:[UnittestRoot defaultSfixed64Extension]]);
1499 XCTAssertFalse([message hasExtension:[UnittestRoot defaultFloatExtension]]);
1500 XCTAssertFalse([message hasExtension:[UnittestRoot defaultDoubleExtension]]);
1501 XCTAssertFalse([message hasExtension:[UnittestRoot defaultBoolExtension]]);
1502 XCTAssertFalse([message hasExtension:[UnittestRoot defaultStringExtension]]);
1503 XCTAssertFalse([message hasExtension:[UnittestRoot defaultBytesExtension]]);
1505 XCTAssertFalse([message hasExtension:[UnittestRoot defaultNestedEnumExtension]]);
1506 XCTAssertFalse([message hasExtension:[UnittestRoot defaultForeignEnumExtension]]);
1507 XCTAssertFalse([message hasExtension:[UnittestRoot defaultImportEnumExtension]]);
1509 XCTAssertFalse([message hasExtension:[UnittestRoot defaultStringPieceExtension]]);
1510 XCTAssertFalse([message hasExtension:[UnittestRoot defaultCordExtension]]);
1513 XCTAssertEqual( 41, [[message getExtension:[UnittestRoot defaultInt32Extension]] intValue]);
1514 …XCTAssertEqual( 42LL, [[message getExtension:[UnittestRoot defaultInt64Extension]] longLongValue]);
1515 …XCTAssertEqual( 43U, [[message getExtension:[UnittestRoot defaultUint32Extension]] unsignedIntValu…
1516 …XCTAssertEqual( 44ULL, [[message getExtension:[UnittestRoot defaultUint64Extension]] unsignedLongL…
1517 XCTAssertEqual(-45, [[message getExtension:[UnittestRoot defaultSint32Extension]] intValue]);
1518 …XCTAssertEqual( 46LL, [[message getExtension:[UnittestRoot defaultSint64Extension]] longLongValue]…
1519 XCTAssertEqual( 47, [[message getExtension:[UnittestRoot defaultFixed32Extension]] intValue]);
1520 …XCTAssertEqual( 48ULL, [[message getExtension:[UnittestRoot defaultFixed64Extension]] unsignedLong…
1521 XCTAssertEqual( 49, [[message getExtension:[UnittestRoot defaultSfixed32Extension]] intValue]);
1522 …XCTAssertEqual(-50LL, [[message getExtension:[UnittestRoot defaultSfixed64Extension]] longLongValu…
1523 …XCTAssertEqualWithAccuracy( 51.5f, [[message getExtension:[UnittestRoot defaultFloatExtension]] fl…
1524 …XCTAssertEqualWithAccuracy( 52e3, [[message getExtension:[UnittestRoot defaultDoubleExtension]] do…
1525 XCTAssertTrue([[message getExtension:[UnittestRoot defaultBoolExtension]] boolValue]);
1526 XCTAssertEqualObjects(@"hello", [message getExtension:[UnittestRoot defaultStringExtension]]);
1527 …XCTAssertEqualObjects([NSData gpbtu_dataWithCString:"world"], [message getExtension:[UnittestRoot …
1530 [[message getExtension:[UnittestRoot defaultNestedEnumExtension]] intValue]);
1532 [[message getExtension:[UnittestRoot defaultForeignEnumExtension]] intValue]);
1534 [[message getExtension:[UnittestRoot defaultImportEnumExtension]] intValue]);
1536 XCTAssertEqualObjects(@"abc", [message getExtension:[UnittestRoot defaultStringPieceExtension]]);
1537 XCTAssertEqualObjects(@"123", [message getExtension:[UnittestRoot defaultCordExtension]]);
1540 - (void)modifyRepeatedFields:(TestAllTypes *)message {
1541 [message.repeatedInt32Array replaceValueAtIndex:1 withValue:501];
1542 [message.repeatedInt64Array replaceValueAtIndex:1 withValue:502];
1543 [message.repeatedUint32Array replaceValueAtIndex:1 withValue:503];
1544 [message.repeatedUint64Array replaceValueAtIndex:1 withValue:504];
1545 [message.repeatedSint32Array replaceValueAtIndex:1 withValue:505];
1546 [message.repeatedSint64Array replaceValueAtIndex:1 withValue:506];
1547 [message.repeatedFixed32Array replaceValueAtIndex:1 withValue:507];
1548 [message.repeatedFixed64Array replaceValueAtIndex:1 withValue:508];
1549 [message.repeatedSfixed32Array replaceValueAtIndex:1 withValue:509];
1550 [message.repeatedSfixed64Array replaceValueAtIndex:1 withValue:510];
1551 [message.repeatedFloatArray replaceValueAtIndex:1 withValue:511];
1552 [message.repeatedDoubleArray replaceValueAtIndex:1 withValue:512];
1553 [message.repeatedBoolArray replaceValueAtIndex:1 withValue:YES];
1554 [message.repeatedStringArray replaceObjectAtIndex:1 withObject:@"515"];
1557 [message.repeatedBytesArray replaceObjectAtIndex:1 withObject:data];
1563 [message.repeatedGroupArray replaceObjectAtIndex:1 withObject:testAll];
1569 [message.repeatedNestedMessageArray replaceObjectAtIndex:1
1575 [message.repeatedForeignMessageArray replaceObjectAtIndex:1
1581 [message.repeatedImportMessageArray replaceObjectAtIndex:1
1585 [message.repeatedNestedEnumArray replaceValueAtIndex:1 withValue:TestAllTypes_NestedEnum_Foo];
1586 [message.repeatedForeignEnumArray replaceValueAtIndex:1 withValue:ForeignEnum_ForeignFoo];
1587 [message.repeatedImportEnumArray replaceValueAtIndex:1 withValue:ImportEnum_ImportFoo];
1589 [message.repeatedStringPieceArray replaceObjectAtIndex:1 withObject:@"524"];
1590 [message.repeatedCordArray replaceObjectAtIndex:1 withObject:@"525"];
1593 - (void)assertRepeatedFieldsModified:(TestAllTypes *)message
1599 XCTAssertEqual(count, message.repeatedInt32Array.count);
1600 XCTAssertEqual(count, message.repeatedInt64Array.count);
1601 XCTAssertEqual(count, message.repeatedUint32Array.count);
1602 XCTAssertEqual(count, message.repeatedUint64Array.count);
1603 XCTAssertEqual(count, message.repeatedSint32Array.count);
1604 XCTAssertEqual(count, message.repeatedSint64Array.count);
1605 XCTAssertEqual(count, message.repeatedFixed32Array.count);
1606 XCTAssertEqual(count, message.repeatedFixed64Array.count);
1607 XCTAssertEqual(count, message.repeatedSfixed32Array.count);
1608 XCTAssertEqual(count, message.repeatedSfixed64Array.count);
1609 XCTAssertEqual(count, message.repeatedFloatArray.count);
1610 XCTAssertEqual(count, message.repeatedDoubleArray.count);
1611 XCTAssertEqual(count, message.repeatedBoolArray.count);
1612 XCTAssertEqual(count, message.repeatedStringArray.count);
1613 XCTAssertEqual(count, message.repeatedBytesArray.count);
1615 XCTAssertEqual(count, message.repeatedGroupArray.count);
1616 XCTAssertEqual(count, message.repeatedNestedMessageArray.count);
1617 XCTAssertEqual(count, message.repeatedForeignMessageArray.count);
1618 XCTAssertEqual(count, message.repeatedImportMessageArray.count);
1619 XCTAssertEqual(count, message.repeatedNestedEnumArray.count);
1620 XCTAssertEqual(count, message.repeatedForeignEnumArray.count);
1621 XCTAssertEqual(count, message.repeatedImportEnumArray.count);
1623 XCTAssertEqual(count, message.repeatedStringPieceArray.count);
1624 XCTAssertEqual(count, message.repeatedCordArray.count);
1626 XCTAssertEqual(count, message.repeatedInt32Array_Count);
1627 XCTAssertEqual(count, message.repeatedInt64Array_Count);
1628 XCTAssertEqual(count, message.repeatedUint32Array_Count);
1629 XCTAssertEqual(count, message.repeatedUint64Array_Count);
1630 XCTAssertEqual(count, message.repeatedSint32Array_Count);
1631 XCTAssertEqual(count, message.repeatedSint64Array_Count);
1632 XCTAssertEqual(count, message.repeatedFixed32Array_Count);
1633 XCTAssertEqual(count, message.repeatedFixed64Array_Count);
1634 XCTAssertEqual(count, message.repeatedSfixed32Array_Count);
1635 XCTAssertEqual(count, message.repeatedSfixed64Array_Count);
1636 XCTAssertEqual(count, message.repeatedFloatArray_Count);
1637 XCTAssertEqual(count, message.repeatedDoubleArray_Count);
1638 XCTAssertEqual(count, message.repeatedBoolArray_Count);
1639 XCTAssertEqual(count, message.repeatedStringArray_Count);
1640 XCTAssertEqual(count, message.repeatedBytesArray_Count);
1642 XCTAssertEqual(count, message.repeatedGroupArray_Count);
1643 XCTAssertEqual(count, message.repeatedNestedMessageArray_Count);
1644 XCTAssertEqual(count, message.repeatedForeignMessageArray_Count);
1645 XCTAssertEqual(count, message.repeatedImportMessageArray_Count);
1646 XCTAssertEqual(count, message.repeatedNestedEnumArray_Count);
1647 XCTAssertEqual(count, message.repeatedForeignEnumArray_Count);
1648 XCTAssertEqual(count, message.repeatedImportEnumArray_Count);
1650 XCTAssertEqual(count, message.repeatedStringPieceArray_Count);
1651 XCTAssertEqual(count, message.repeatedCordArray_Count);
1653 XCTAssertEqual(201, [message.repeatedInt32Array valueAtIndex:0]);
1654 XCTAssertEqual(202LL, [message.repeatedInt64Array valueAtIndex:0]);
1655 XCTAssertEqual(203U, [message.repeatedUint32Array valueAtIndex:0]);
1656 XCTAssertEqual(204ULL, [message.repeatedUint64Array valueAtIndex:0]);
1657 XCTAssertEqual(205, [message.repeatedSint32Array valueAtIndex:0]);
1658 XCTAssertEqual(206LL, [message.repeatedSint64Array valueAtIndex:0]);
1659 XCTAssertEqual(207U, [message.repeatedFixed32Array valueAtIndex:0]);
1660 XCTAssertEqual(208ULL, [message.repeatedFixed64Array valueAtIndex:0]);
1661 XCTAssertEqual(209, [message.repeatedSfixed32Array valueAtIndex:0]);
1662 XCTAssertEqual(210LL, [message.repeatedSfixed64Array valueAtIndex:0]);
1663 XCTAssertEqualWithAccuracy(211.0f, [message.repeatedFloatArray valueAtIndex:0], 0.01);
1664 XCTAssertEqualWithAccuracy(212.0, [message.repeatedDoubleArray valueAtIndex:0], 0.01);
1665 XCTAssertFalse([message.repeatedBoolArray valueAtIndex:0]);
1666 XCTAssertEqualObjects(@"215", message.repeatedStringArray[0]);
1668 message.repeatedBytesArray[0]);
1670 XCTAssertEqual(217, ((TestAllTypes_RepeatedGroup*)message.repeatedGroupArray[0]).a);
1671 XCTAssertEqual(218, ((TestAllTypes_NestedMessage*)message.repeatedNestedMessageArray[0]).bb);
1672 XCTAssertEqual(219, ((ForeignMessage*)message.repeatedForeignMessageArray[0]).c);
1673 XCTAssertEqual(220, ((ImportMessage*)message.repeatedImportMessageArray[0]).d);
1675 XCTAssertEqual(TestAllTypes_NestedEnum_Baz, [message.repeatedNestedEnumArray valueAtIndex:0]);
1676 XCTAssertEqual(ForeignEnum_ForeignBaz, [message.repeatedForeignEnumArray valueAtIndex:0]);
1677 XCTAssertEqual(ImportEnum_ImportBaz, [message.repeatedImportEnumArray valueAtIndex:0]);
1679 XCTAssertEqualObjects(@"224", message.repeatedStringPieceArray[0]);
1680 XCTAssertEqualObjects(@"225", message.repeatedCordArray[0]);
1683 XCTAssertEqual(501, [message.repeatedInt32Array valueAtIndex:1]);
1684 XCTAssertEqual(502LL, [message.repeatedInt64Array valueAtIndex:1]);
1685 XCTAssertEqual(503U, [message.repeatedUint32Array valueAtIndex:1]);
1686 XCTAssertEqual(504ULL, [message.repeatedUint64Array valueAtIndex:1]);
1687 XCTAssertEqual(505, [message.repeatedSint32Array valueAtIndex:1]);
1688 XCTAssertEqual(506LL, [message.repeatedSint64Array valueAtIndex:1]);
1689 XCTAssertEqual(507U, [message.repeatedFixed32Array valueAtIndex:1]);
1690 XCTAssertEqual(508ULL, [message.repeatedFixed64Array valueAtIndex:1]);
1691 XCTAssertEqual(509, [message.repeatedSfixed32Array valueAtIndex:1]);
1692 XCTAssertEqual(510LL, [message.repeatedSfixed64Array valueAtIndex:1]);
1693 XCTAssertEqualWithAccuracy(511.0f, [message.repeatedFloatArray valueAtIndex:1], 0.01);
1694 XCTAssertEqualWithAccuracy(512.0, [message.repeatedDoubleArray valueAtIndex:1], 0.01);
1695 XCTAssertTrue([message.repeatedBoolArray valueAtIndex:1]);
1696 XCTAssertEqualObjects(@"515", message.repeatedStringArray[1]);
1698 message.repeatedBytesArray[1]);
1700 XCTAssertEqual(517, ((TestAllTypes_RepeatedGroup*)message.repeatedGroupArray[1]).a);
1701 XCTAssertEqual(518, ((TestAllTypes_NestedMessage*)message.repeatedNestedMessageArray[1]).bb);
1702 XCTAssertEqual(519, ((ForeignMessage*)message.repeatedForeignMessageArray[1]).c);
1703 XCTAssertEqual(520, ((ImportMessage*)message.repeatedImportMessageArray[1]).d);
1705 XCTAssertEqual(TestAllTypes_NestedEnum_Foo, [message.repeatedNestedEnumArray valueAtIndex:1]);
1706 XCTAssertEqual(ForeignEnum_ForeignFoo, [message.repeatedForeignEnumArray valueAtIndex:1]);
1707 XCTAssertEqual(ImportEnum_ImportFoo, [message.repeatedImportEnumArray valueAtIndex:1]);
1709 XCTAssertEqualObjects(@"524", message.repeatedStringPieceArray[1]);
1710 XCTAssertEqualObjects(@"525", message.repeatedCordArray[1]);
1713 - (void)setPackedFields:(TestPackedTypes *)message
1719 [message.packedInt32Array addValue:601 + i * 100];
1722 [message.packedInt64Array addValue:602 + i * 100];
1725 [message.packedUint32Array addValue:603 + i * 100];
1728 [message.packedUint64Array addValue:604 + i * 100];
1731 [message.packedSint32Array addValue:605 + i * 100];
1734 [message.packedSint64Array addValue:606 + i * 100];
1737 [message.packedFixed32Array addValue:607 + i * 100];
1740 [message.packedFixed64Array addValue:608 + i * 100];
1743 [message.packedSfixed32Array addValue:609 + i * 100];
1746 [message.packedSfixed64Array addValue:610 + i * 100];
1749 [message.packedFloatArray addValue:611 + i * 100];
1752 [message.packedDoubleArray addValue:612 + i * 100];
1755 [message.packedBoolArray addValue:(i % 2) ? YES : NO];
1758 [message.packedEnumArray
1763 - (void)setUnpackedFields:(TestUnpackedTypes *)message
1769 [message.unpackedInt32Array addValue:601 + i * 100];
1772 [message.unpackedInt64Array addValue:602 + i * 100];
1775 [message.unpackedUint32Array addValue:603 + i * 100];
1778 [message.unpackedUint64Array addValue:604 + i * 100];
1781 [message.unpackedSint32Array addValue:605 + i * 100];
1784 [message.unpackedSint64Array addValue:606 + i * 100];
1787 [message.unpackedFixed32Array addValue:607 + i * 100];
1790 [message.unpackedFixed64Array addValue:608 + i * 100];
1793 [message.unpackedSfixed32Array addValue:609 + i * 100];
1796 [message.unpackedSfixed64Array addValue:610 + i * 100];
1799 [message.unpackedFloatArray addValue:611 + i * 100];
1802 [message.unpackedDoubleArray addValue:612 + i * 100];
1805 [message.unpackedBoolArray addValue:(i % 2) ? YES : NO];
1808 [message.unpackedEnumArray
1813 - (void)assertPackedFieldsSet:(TestPackedTypes *)message
1815 XCTAssertEqual(count, message.packedInt32Array.count);
1816 XCTAssertEqual(count, message.packedInt64Array.count);
1817 XCTAssertEqual(count, message.packedUint32Array.count);
1818 XCTAssertEqual(count, message.packedUint64Array.count);
1819 XCTAssertEqual(count, message.packedSint32Array.count);
1820 XCTAssertEqual(count, message.packedSint64Array.count);
1821 XCTAssertEqual(count, message.packedFixed32Array.count);
1822 XCTAssertEqual(count, message.packedFixed64Array.count);
1823 XCTAssertEqual(count, message.packedSfixed32Array.count);
1824 XCTAssertEqual(count, message.packedSfixed64Array.count);
1825 XCTAssertEqual(count, message.packedFloatArray.count);
1826 XCTAssertEqual(count, message.packedDoubleArray.count);
1827 XCTAssertEqual(count, message.packedBoolArray.count);
1828 XCTAssertEqual(count, message.packedEnumArray.count);
1831 [message.packedInt32Array valueAtIndex:i]);
1832 XCTAssertEqual(602 + i * 100, [message.packedInt64Array valueAtIndex:i]);
1833 XCTAssertEqual(603 + i * 100, [message.packedUint32Array valueAtIndex:i]);
1834 XCTAssertEqual(604 + i * 100, [message.packedUint64Array valueAtIndex:i]);
1836 [message.packedSint32Array valueAtIndex:i]);
1837 XCTAssertEqual(606 + i * 100, [message.packedSint64Array valueAtIndex:i]);
1838 XCTAssertEqual(607 + i * 100, [message.packedFixed32Array valueAtIndex:i]);
1839 XCTAssertEqual(608 + i * 100, [message.packedFixed64Array valueAtIndex:i]);
1841 [message.packedSfixed32Array valueAtIndex:i]);
1842 XCTAssertEqual(610 + i * 100, [message.packedSfixed64Array valueAtIndex:i]);
1844 [message.packedFloatArray valueAtIndex:i], 0.01);
1846 612 + i * 100, [message.packedDoubleArray valueAtIndex:i], 0.01);
1848 [message.packedBoolArray valueAtIndex:i]);
1850 [message.packedEnumArray valueAtIndex:i]);
1854 - (void)setPackedExtensions:(TestPackedExtensions *)message
1860 [message addExtension:[UnittestRoot packedInt32Extension]
1862 [message addExtension:[UnittestRoot packedInt64Extension]
1864 [message addExtension:[UnittestRoot packedUint32Extension]
1866 [message addExtension:[UnittestRoot packedUint64Extension]
1868 [message addExtension:[UnittestRoot packedSint32Extension]
1870 [message addExtension:[UnittestRoot packedSint64Extension]
1872 [message addExtension:[UnittestRoot packedFixed32Extension]
1874 [message addExtension:[UnittestRoot packedFixed64Extension]
1876 [message addExtension:[UnittestRoot packedSfixed32Extension]
1878 [message addExtension:[UnittestRoot packedSfixed64Extension]
1880 [message addExtension:[UnittestRoot packedFloatExtension]
1882 [message addExtension:[UnittestRoot packedDoubleExtension]
1884 [message addExtension:[UnittestRoot packedBoolExtension]
1886 [message addExtension:[UnittestRoot packedEnumExtension]
1892 - (void)setUnpackedExtensions:(TestUnpackedExtensions *)message
1898 [message addExtension:[UnittestRoot unpackedInt32Extension]
1900 [message addExtension:[UnittestRoot unpackedInt64Extension]
1902 [message addExtension:[UnittestRoot unpackedUint32Extension]
1904 [message addExtension:[UnittestRoot unpackedUint64Extension]
1906 [message addExtension:[UnittestRoot unpackedSint32Extension]
1908 [message addExtension:[UnittestRoot unpackedSint64Extension]
1910 [message addExtension:[UnittestRoot unpackedFixed32Extension]
1912 [message addExtension:[UnittestRoot unpackedFixed64Extension]
1914 [message addExtension:[UnittestRoot unpackedSfixed32Extension]
1916 [message addExtension:[UnittestRoot unpackedSfixed64Extension]
1918 [message addExtension:[UnittestRoot unpackedFloatExtension]
1920 [message addExtension:[UnittestRoot unpackedDoubleExtension]
1922 [message addExtension:[UnittestRoot unpackedBoolExtension]
1924 [message addExtension:[UnittestRoot unpackedEnumExtension]
1930 - (void)assertPackedExtensionsSet:(TestPackedExtensions *)message
1932 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedInt32Extension]] count]);
1933 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedInt64Extension]] count]);
1934 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedUint32Extension]] count]);
1935 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedUint64Extension]] count]);
1936 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedSint32Extension]] count]);
1937 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedSint64Extension]] count]);
1938 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedFixed32Extension]] count]);
1939 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedFixed64Extension]] count]);
1940 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedSfixed32Extension]] count]);
1941 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedSfixed64Extension]] count]);
1942 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedFloatExtension]] count]);
1943 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedDoubleExtension]] count]);
1944 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedBoolExtension]] count]);
1945 XCTAssertEqual(count, [[message getExtension:[UnittestRoot packedEnumExtension]] count]);
1948 id extension = [message getExtension:[UnittestRoot packedInt32Extension]];
1950 extension = [message getExtension:[UnittestRoot packedInt64Extension]];
1952 extension = [message getExtension:[UnittestRoot packedUint32Extension]];
1954 extension = [message getExtension:[UnittestRoot packedUint64Extension]];
1956 extension = [message getExtension:[UnittestRoot packedSint32Extension]];
1958 extension = [message getExtension:[UnittestRoot packedSint64Extension]];
1960 extension = [message getExtension:[UnittestRoot packedFixed32Extension]];
1962 extension = [message getExtension:[UnittestRoot packedFixed64Extension]];
1964 extension = [message getExtension:[UnittestRoot packedSfixed32Extension]];
1966 extension = [message getExtension:[UnittestRoot packedSfixed64Extension]];
1968 extension = [message getExtension:[UnittestRoot packedFloatExtension]];
1970 extension = [message getExtension:[UnittestRoot packedDoubleExtension]];
1972 extension = [message getExtension:[UnittestRoot packedBoolExtension]];
1974 extension = [message getExtension:[UnittestRoot packedEnumExtension]];
1980 - (void)assertAllFieldsKVCMatch:(TestAllTypes *)message {
1981 XCTAssertEqualObjects([message valueForKey:@"hasOptionalInt32"], @YES);
1982 XCTAssertEqualObjects(@(message.optionalInt32), [message valueForKey:@"optionalInt32"]);
1983 XCTAssertEqualObjects([message valueForKey:@"hasOptionalInt64"], @YES);
1984 XCTAssertEqualObjects(@(message.optionalInt64), [message valueForKey:@"optionalInt64"]);
1985 XCTAssertEqualObjects([message valueForKey:@"hasOptionalUint32"], @YES);
1986 XCTAssertEqualObjects(@(message.optionalUint32), [message valueForKey:@"optionalUint32"]);
1987 XCTAssertEqualObjects([message valueForKey:@"hasOptionalUint64"], @YES);
1988 XCTAssertEqualObjects(@(message.optionalUint64), [message valueForKey:@"optionalUint64"]);
1989 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSint32"], @YES);
1990 XCTAssertEqualObjects(@(message.optionalSint32), [message valueForKey:@"optionalSint32"]);
1991 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSint64"], @YES);
1992 XCTAssertEqualObjects(@(message.optionalSint64), [message valueForKey:@"optionalSint64"]);
1993 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFixed32"], @YES);
1994 XCTAssertEqualObjects(@(message.optionalFixed32), [message valueForKey:@"optionalFixed32"]);
1995 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFixed64"], @YES);
1996 XCTAssertEqualObjects(@(message.optionalFixed64), [message valueForKey:@"optionalFixed64"]);
1997 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSfixed32"], @YES);
1998 XCTAssertEqualObjects(@(message.optionalSfixed32), [message valueForKey:@"optionalSfixed32"]);
1999 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSfixed64"], @YES);
2000 XCTAssertEqualObjects(@(message.optionalSfixed64), [message valueForKey:@"optionalSfixed64"]);
2001 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFloat"], @YES);
2002 XCTAssertEqualObjects(@(message.optionalFloat), [message valueForKey:@"optionalFloat"]);
2003 XCTAssertEqualObjects([message valueForKey:@"hasOptionalDouble"], @YES);
2004 XCTAssertEqualObjects(@(message.optionalDouble), [message valueForKey:@"optionalDouble"]);
2005 XCTAssertEqualObjects([message valueForKey:@"hasOptionalBool"], @YES);
2006 XCTAssertEqualObjects(@(message.optionalBool), [message valueForKey:@"optionalBool"]);
2007 XCTAssertEqualObjects([message valueForKey:@"hasOptionalString"], @YES);
2008 XCTAssertEqualObjects(message.optionalString, [message valueForKey:@"optionalString"]);
2009 XCTAssertEqualObjects([message valueForKey:@"hasOptionalBytes"], @YES);
2010 XCTAssertEqualObjects(message.optionalBytes, [message valueForKey:@"optionalBytes"]);
2012 XCTAssertEqualObjects([message valueForKey:@"hasOptionalGroup"], @YES);
2013 XCTAssertNotNil(message.optionalGroup);
2014 XCTAssertEqualObjects([message valueForKeyPath:@"optionalGroup.hasA"], @YES);
2015 XCTAssertEqualObjects(@(message.optionalGroup.a), [message valueForKeyPath:@"optionalGroup.a"]);
2016 XCTAssertEqualObjects([message valueForKey:@"hasOptionalNestedMessage"], @YES);
2017 XCTAssertNotNil(message.optionalNestedMessage);
2018 XCTAssertEqualObjects([message valueForKeyPath:@"optionalNestedMessage.hasBb"], @YES);
2019 …XCTAssertEqualObjects(@(message.optionalNestedMessage.bb), [message valueForKeyPath:@"optionalNest…
2020 XCTAssertEqualObjects([message valueForKey:@"hasOptionalForeignMessage"], @YES);
2021 XCTAssertNotNil(message.optionalForeignMessage);
2022 XCTAssertEqualObjects([message valueForKeyPath:@"optionalForeignMessage.hasC"], @YES);
2023 …XCTAssertEqualObjects(@(message.optionalForeignMessage.c), [message valueForKeyPath:@"optionalFore…
2024 XCTAssertEqualObjects([message valueForKey:@"hasOptionalImportMessage"], @YES);
2025 XCTAssertNotNil(message.optionalForeignMessage);
2026 XCTAssertEqualObjects([message valueForKeyPath:@"optionalImportMessage.hasD"], @YES);
2027 …XCTAssertEqualObjects(@(message.optionalImportMessage.d), [message valueForKeyPath:@"optionalImpor…
2029 XCTAssertEqualObjects([message valueForKey:@"hasOptionalNestedEnum"], @YES);
2030 XCTAssertEqualObjects(@(message.optionalNestedEnum), [message valueForKey:@"optionalNestedEnum"]);
2031 XCTAssertEqualObjects([message valueForKey:@"hasOptionalForeignEnum"], @YES);
2032 …XCTAssertEqualObjects(@(message.optionalForeignEnum), [message valueForKey:@"optionalForeignEnum"]…
2033 XCTAssertEqualObjects([message valueForKey:@"hasOptionalImportEnum"], @YES);
2034 XCTAssertEqualObjects(@(message.optionalImportEnum), [message valueForKey:@"optionalImportEnum"]);
2036 XCTAssertEqualObjects([message valueForKey:@"hasOptionalStringPiece"], @YES);
2037 XCTAssertEqualObjects(message.optionalStringPiece, [message valueForKey:@"optionalStringPiece"]);
2038 XCTAssertEqualObjects([message valueForKey:@"hasOptionalCord"], @YES);
2039 XCTAssertEqualObjects(message.optionalCord, [message valueForKey:@"optionalCord"]);
2045 XCTAssertEqualObjects(message.repeatedInt32Array, [message valueForKey:@"repeatedInt32Array"]);
2046 XCTAssertEqualObjects(message.repeatedInt64Array, [message valueForKey:@"repeatedInt64Array"]);
2047 XCTAssertEqualObjects(message.repeatedUint32Array, [message valueForKey:@"repeatedUint32Array"]);
2048 XCTAssertEqualObjects(message.repeatedUint64Array, [message valueForKey:@"repeatedUint64Array"]);
2049 XCTAssertEqualObjects(message.repeatedSint32Array, [message valueForKey:@"repeatedSint32Array"]);
2050 XCTAssertEqualObjects(message.repeatedSint64Array, [message valueForKey:@"repeatedSint64Array"]);
2051 …XCTAssertEqualObjects(message.repeatedFixed32Array, [message valueForKey:@"repeatedFixed32Array"]);
2052 …XCTAssertEqualObjects(message.repeatedFixed64Array, [message valueForKey:@"repeatedFixed64Array"]);
2053 …XCTAssertEqualObjects(message.repeatedSfixed32Array, [message valueForKey:@"repeatedSfixed32Array"…
2054 …XCTAssertEqualObjects(message.repeatedSfixed64Array, [message valueForKey:@"repeatedSfixed64Array"…
2055 XCTAssertEqualObjects(message.repeatedFloatArray, [message valueForKey:@"repeatedFloatArray"]);
2056 XCTAssertEqualObjects(message.repeatedDoubleArray, [message valueForKey:@"repeatedDoubleArray"]);
2057 XCTAssertEqualObjects(message.repeatedBoolArray, [message valueForKey:@"repeatedBoolArray"]);
2058 XCTAssertEqualObjects(message.repeatedStringArray, [message valueForKey:@"repeatedStringArray"]);
2059 XCTAssertEqualObjects(message.repeatedBytesArray, [message valueForKey:@"repeatedBytesArray"]);
2061 XCTAssertEqualObjects(message.repeatedGroupArray, [message valueForKey:@"repeatedGroupArray"]);
2062 …XCTAssertEqualObjects(message.repeatedNestedMessageArray, [message valueForKey:@"repeatedNestedMes…
2063 …XCTAssertEqualObjects(message.repeatedForeignMessageArray, [message valueForKey:@"repeatedForeignM…
2064 …XCTAssertEqualObjects(message.repeatedImportMessageArray, [message valueForKey:@"repeatedImportMes…
2066 …XCTAssertEqualObjects(message.repeatedNestedEnumArray, [message valueForKey:@"repeatedNestedEnumAr…
2067 …XCTAssertEqualObjects(message.repeatedForeignEnumArray, [message valueForKey:@"repeatedForeignEnum…
2068 …XCTAssertEqualObjects(message.repeatedImportEnumArray, [message valueForKey:@"repeatedImportEnumAr…
2070 …XCTAssertEqualObjects(message.repeatedStringPieceArray, [message valueForKey:@"repeatedStringPiece…
2071 XCTAssertEqualObjects(message.repeatedCordArray, [message valueForKey:@"repeatedCordArray"]);
2073 …XCTAssertEqualObjects(@(message.repeatedInt32Array_Count), [message valueForKey:@"repeatedInt32Arr…
2074 …XCTAssertEqualObjects(@(message.repeatedInt64Array_Count), [message valueForKey:@"repeatedInt64Arr…
2075 …XCTAssertEqualObjects(@(message.repeatedUint32Array_Count), [message valueForKey:@"repeatedUint32A…
2076 …XCTAssertEqualObjects(@(message.repeatedUint64Array_Count), [message valueForKey:@"repeatedUint64A…
2077 …XCTAssertEqualObjects(@(message.repeatedSint32Array_Count), [message valueForKey:@"repeatedSint32A…
2078 …XCTAssertEqualObjects(@(message.repeatedSint64Array_Count), [message valueForKey:@"repeatedSint64A…
2079 …XCTAssertEqualObjects(@(message.repeatedFixed32Array_Count), [message valueForKey:@"repeatedFixed3…
2080 …XCTAssertEqualObjects(@(message.repeatedFixed64Array_Count), [message valueForKey:@"repeatedFixed6…
2081 …XCTAssertEqualObjects(@(message.repeatedSfixed32Array_Count), [message valueForKey:@"repeatedSfixe…
2082 …XCTAssertEqualObjects(@(message.repeatedSfixed64Array_Count), [message valueForKey:@"repeatedSfixe…
2083 …XCTAssertEqualObjects(@(message.repeatedFloatArray_Count), [message valueForKey:@"repeatedFloatArr…
2084 …XCTAssertEqualObjects(@(message.repeatedDoubleArray_Count), [message valueForKey:@"repeatedDoubleA…
2085 …XCTAssertEqualObjects(@(message.repeatedBoolArray_Count), [message valueForKey:@"repeatedBoolArray…
2086 …XCTAssertEqualObjects(@(message.repeatedStringArray_Count), [message valueForKey:@"repeatedStringA…
2087 …XCTAssertEqualObjects(@(message.repeatedBytesArray_Count), [message valueForKey:@"repeatedBytesArr…
2089 …XCTAssertEqualObjects(@(message.repeatedGroupArray_Count), [message valueForKey:@"repeatedGroupArr…
2090 …XCTAssertEqualObjects(@(message.repeatedNestedMessageArray_Count), [message valueForKey:@"repeated…
2091 …XCTAssertEqualObjects(@(message.repeatedForeignMessageArray_Count), [message valueForKey:@"repeate…
2092 …XCTAssertEqualObjects(@(message.repeatedImportMessageArray_Count), [message valueForKey:@"repeated…
2094 …XCTAssertEqualObjects(@(message.repeatedNestedEnumArray_Count), [message valueForKey:@"repeatedNes…
2095 …XCTAssertEqualObjects(@(message.repeatedForeignEnumArray_Count), [message valueForKey:@"repeatedFo…
2096 …XCTAssertEqualObjects(@(message.repeatedImportEnumArray_Count), [message valueForKey:@"repeatedImp…
2098 …XCTAssertEqualObjects(@(message.repeatedStringPieceArray_Count), [message valueForKey:@"repeatedSt…
2099 …XCTAssertEqualObjects(@(message.repeatedCordArray_Count), [message valueForKey:@"repeatedCordArray…
2103 XCTAssertEqualObjects([message valueForKey:@"hasDefaultInt32"], @YES);
2104 XCTAssertEqualObjects(@(message.defaultInt32), [message valueForKey:@"defaultInt32"]);
2105 XCTAssertEqualObjects([message valueForKey:@"hasDefaultInt64"], @YES);
2106 XCTAssertEqualObjects(@(message.defaultInt64), [message valueForKey:@"defaultInt64"]);
2107 XCTAssertEqualObjects([message valueForKey:@"hasDefaultUint32"], @YES);
2108 XCTAssertEqualObjects(@(message.defaultUint32), [message valueForKey:@"defaultUint32"]);
2109 XCTAssertEqualObjects([message valueForKey:@"hasDefaultUint64"], @YES);
2110 XCTAssertEqualObjects(@(message.defaultUint64), [message valueForKey:@"defaultUint64"]);
2111 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSint32"], @YES);
2112 XCTAssertEqualObjects(@(message.defaultSint32), [message valueForKey:@"defaultSint32"]);
2113 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSint64"], @YES);
2114 XCTAssertEqualObjects(@(message.defaultSint64), [message valueForKey:@"defaultSint64"]);
2115 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFixed32"], @YES);
2116 XCTAssertEqualObjects(@(message.defaultFixed32), [message valueForKey:@"defaultFixed32"]);
2117 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFixed64"], @YES);
2118 XCTAssertEqualObjects(@(message.defaultFixed64), [message valueForKey:@"defaultFixed64"]);
2119 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSfixed32"], @YES);
2120 XCTAssertEqualObjects(@(message.defaultSfixed32), [message valueForKey:@"defaultSfixed32"]);
2121 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSfixed64"], @YES);
2122 XCTAssertEqualObjects(@(message.defaultSfixed64), [message valueForKey:@"defaultSfixed64"]);
2123 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFloat"], @YES);
2124 XCTAssertEqualObjects(@(message.defaultFloat), [message valueForKey:@"defaultFloat"]);
2125 XCTAssertEqualObjects([message valueForKey:@"hasDefaultDouble"], @YES);
2126 XCTAssertEqualObjects(@(message.defaultDouble), [message valueForKey:@"defaultDouble"]);
2127 XCTAssertEqualObjects([message valueForKey:@"hasDefaultBool"], @YES);
2128 XCTAssertEqualObjects(@(message.defaultBool), [message valueForKey:@"defaultBool"]);
2129 XCTAssertEqualObjects([message valueForKey:@"hasDefaultString"], @YES);
2130 XCTAssertEqualObjects(message.defaultString, [message valueForKey:@"defaultString"]);
2131 XCTAssertEqualObjects([message valueForKey:@"hasDefaultBytes"], @YES);
2132 XCTAssertEqualObjects(message.defaultBytes, [message valueForKey:@"defaultBytes"]);
2134 XCTAssertEqualObjects([message valueForKey:@"hasDefaultNestedEnum"], @YES);
2135 XCTAssertEqualObjects(@(message.defaultNestedEnum), [message valueForKey:@"defaultNestedEnum"]);
2136 XCTAssertEqualObjects([message valueForKey:@"hasDefaultForeignEnum"], @YES);
2137 XCTAssertEqualObjects(@(message.defaultForeignEnum), [message valueForKey:@"defaultForeignEnum"]);
2138 XCTAssertEqualObjects([message valueForKey:@"hasDefaultImportEnum"], @YES);
2139 XCTAssertEqualObjects(@(message.defaultImportEnum), [message valueForKey:@"defaultImportEnum"]);
2141 XCTAssertEqualObjects([message valueForKey:@"hasDefaultStringPiece"], @YES);
2142 XCTAssertEqualObjects(message.defaultStringPiece, [message valueForKey:@"defaultStringPiece"]);
2143 XCTAssertEqualObjects([message valueForKey:@"hasDefaultCord"], @YES);
2144 XCTAssertEqualObjects(message.defaultCord, [message valueForKey:@"defaultCord"]);
2147 - (void)setAllFieldsViaKVC:(TestAllTypes *)message
2149 [message setValue:@101 forKey:@"optionalInt32"];
2150 [message setValue:@102 forKey:@"optionalInt64"];
2151 [message setValue:@103 forKey:@"optionalUint32"];
2152 [message setValue:@104 forKey:@"optionalUint64"];
2153 [message setValue:@105 forKey:@"optionalSint32"];
2154 [message setValue:@106 forKey:@"optionalSint64"];
2155 [message setValue:@107 forKey:@"optionalFixed32"];
2156 [message setValue:@108 forKey:@"optionalFixed64"];
2157 [message setValue:@109 forKey:@"optionalSfixed32"];
2158 [message setValue:@110 forKey:@"optionalSfixed64"];
2159 [message setValue:@111 forKey:@"optionalFloat"];
2160 [message setValue:@112 forKey:@"optionalDouble"];
2161 [message setValue:@YES forKey:@"optionalBool"];
2162 [message setValue:@"115" forKey:@"optionalString"];
2163 [message setValue:[NSData gpbtu_dataWithEmbeddedNulls]
2166 TestAllTypes_OptionalGroup *allTypes = [TestAllTypes_OptionalGroup message];
2168 [message setValue:allTypes forKey:@"optionalGroup"];
2170 [TestAllTypes_NestedMessage message];
2172 [message setValue:nestedMessage forKey:@"optionalNestedMessage"];
2173 ForeignMessage *foreignMessage = [ForeignMessage message];
2175 [message setValue:foreignMessage forKey:@"optionalForeignMessage"];
2176 ImportMessage *importMessage = [ImportMessage message];
2178 [message setValue:importMessage forKey:@"optionalImportMessage"];
2180 [message setValue:@(TestAllTypes_NestedEnum_Baz)
2182 [message setValue:@(ForeignEnum_ForeignBaz) forKey:@"optionalForeignEnum"];
2183 [message setValue:@(ImportEnum_ImportBaz) forKey:@"optionalImportEnum"];
2185 [message setValue:@"124" forKey:@"optionalStringPiece"];
2186 [message setValue:@"125" forKey:@"optionalCord"];
2195 [message setValue:scratch forKey:@"repeatedInt32Array"];
2202 [message setValue:scratch forKey:@"repeatedInt64Array"];
2209 [message setValue:scratch forKey:@"repeatedUint32Array"];
2216 [message setValue:scratch forKey:@"repeatedUint64Array"];
2223 [message setValue:scratch forKey:@"repeatedSint32Array"];
2230 [message setValue:scratch forKey:@"repeatedSint64Array"];
2237 [message setValue:scratch forKey:@"repeatedFixed32Array"];
2244 [message setValue:scratch forKey:@"repeatedFixed64Array"];
2251 [message setValue:scratch forKey:@"repeatedSfixed32Array"];
2258 [message setValue:scratch forKey:@"repeatedSfixed64Array"];
2265 [message setValue:scratch forKey:@"repeatedFloatArray"];
2272 [message setValue:scratch forKey:@"repeatedDoubleArray"];
2279 [message setValue:scratch forKey:@"repeatedBoolArray"];
2288 [message setValue:array forKey:@"repeatedStringArray"];
2297 [message setValue:array forKey:@"repeatedBytesArray"];
2308 [message setValue:array forKey:@"repeatedGroupArray"];
2318 [message setValue:array forKey:@"repeatedNestedMessageArray"];
2328 [message setValue:array forKey:@"repeatedForeignMessageArray"];
2338 [message setValue:array forKey:@"repeatedImportMessageArray"];
2348 [message setValue:scratch forKey:@"repeatedNestedEnumArray"];
2357 [message setValue:scratch forKey:@"repeatedForeignEnumArray"];
2365 [message setValue:scratch forKey:@"repeatedImportEnumArray"];
2374 [message setValue:array forKey:@"repeatedStringPieceArray"];
2383 [message setValue:array forKey:@"repeatedCordArray"];
2388 [message setValue:@401 forKey:@"defaultInt32"];
2389 [message setValue:@402 forKey:@"defaultInt64"];
2390 [message setValue:@403 forKey:@"defaultUint32"];
2391 [message setValue:@404 forKey:@"defaultUint64"];
2392 [message setValue:@405 forKey:@"defaultSint32"];
2393 [message setValue:@406 forKey:@"defaultSint64"];
2394 [message setValue:@407 forKey:@"defaultFixed32"];
2395 [message setValue:@408 forKey:@"defaultFixed64"];
2396 [message setValue:@409 forKey:@"defaultSfixed32"];
2397 [message setValue:@410 forKey:@"defaultSfixed64"];
2398 [message setValue:@411 forKey:@"defaultFloat"];
2399 [message setValue:@412 forKey:@"defaultDouble"];
2400 [message setValue:@NO forKey:@"defaultBool"];
2401 [message setValue:@"415" forKey:@"defaultString"];
2402 [message setValue:[NSData gpbtu_dataWithUint32:416] forKey:@"defaultBytes"];
2404 [message setValue:@(TestAllTypes_NestedEnum_Foo) forKey:@"defaultNestedEnum"];
2405 [message setValue:@(ForeignEnum_ForeignFoo) forKey:@"defaultForeignEnum"];
2406 [message setValue:@(ImportEnum_ImportFoo) forKey:@"defaultImportEnum"];
2408 [message setValue:@"424" forKey:@"defaultStringPiece"];
2409 [message setValue:@"425" forKey:@"defaultCord"];
2412 - (void)assertClearKVC:(TestAllTypes *)message {
2413 XCTAssertEqualObjects([message valueForKey:@"hasOptionalInt32"], @NO);
2414 XCTAssertEqualObjects([message valueForKey:@"hasOptionalInt64"], @NO);
2415 XCTAssertEqualObjects([message valueForKey:@"hasOptionalUint32"], @NO);
2416 XCTAssertEqualObjects([message valueForKey:@"hasOptionalUint64"], @NO);
2417 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSint32"], @NO);
2418 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSint64"], @NO);
2419 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFixed32"], @NO);
2420 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFixed64"], @NO);
2421 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSfixed32"], @NO);
2422 XCTAssertEqualObjects([message valueForKey:@"hasOptionalSfixed64"], @NO);
2423 XCTAssertEqualObjects([message valueForKey:@"hasOptionalFloat"], @NO);
2424 XCTAssertEqualObjects([message valueForKey:@"hasOptionalDouble"], @NO);
2425 XCTAssertEqualObjects([message valueForKey:@"hasOptionalBool"], @NO);
2426 XCTAssertEqualObjects([message valueForKey:@"hasOptionalString"], @NO);
2427 XCTAssertEqualObjects([message valueForKey:@"hasOptionalBytes"], @NO);
2429 XCTAssertEqualObjects([message valueForKey:@"hasOptionalGroup"], @NO);
2430 XCTAssertEqualObjects([message valueForKey:@"hasOptionalNestedMessage"], @NO);
2431 XCTAssertEqualObjects([message valueForKey:@"hasOptionalForeignMessage"],
2433 XCTAssertEqualObjects([message valueForKey:@"hasOptionalImportMessage"], @NO);
2435 XCTAssertEqualObjects([message valueForKey:@"hasOptionalNestedEnum"], @NO);
2436 XCTAssertEqualObjects([message valueForKey:@"hasOptionalForeignEnum"], @NO);
2437 XCTAssertEqualObjects([message valueForKey:@"hasOptionalImportEnum"], @NO);
2439 XCTAssertEqualObjects([message valueForKey:@"hasOptionalStringPiece"], @NO);
2440 XCTAssertEqualObjects([message valueForKey:@"hasOptionalCord"], @NO);
2443 XCTAssertEqualObjects([message valueForKey:@"optionalInt32"], @0);
2444 XCTAssertEqualObjects([message valueForKey:@"optionalInt64"], @0);
2445 XCTAssertEqualObjects([message valueForKey:@"optionalUint32"], @0);
2446 XCTAssertEqualObjects([message valueForKey:@"optionalUint64"], @0);
2447 XCTAssertEqualObjects([message valueForKey:@"optionalSint32"], @0);
2448 XCTAssertEqualObjects([message valueForKey:@"optionalSint64"], @0);
2449 XCTAssertEqualObjects([message valueForKey:@"optionalFixed32"], @0);
2450 XCTAssertEqualObjects([message valueForKey:@"optionalFixed64"], @0);
2451 XCTAssertEqualObjects([message valueForKey:@"optionalSfixed32"], @0);
2452 XCTAssertEqualObjects([message valueForKey:@"optionalSfixed64"], @0);
2453 XCTAssertEqualObjects([message valueForKey:@"optionalFloat"], @0);
2454 XCTAssertEqualObjects([message valueForKey:@"optionalDouble"], @0);
2455 XCTAssertEqualObjects([message valueForKey:@"optionalBool"], @NO);
2456 XCTAssertEqualObjects([message valueForKey:@"optionalString"], @"");
2457 XCTAssertEqualObjects([message valueForKey:@"optionalBytes"],
2461 XCTAssertNotNil([message valueForKeyPath:@"optionalGroup"]);
2462 XCTAssertNotNil([message valueForKeyPath:@"optionalNestedMessage"]);
2463 XCTAssertNotNil([message valueForKeyPath:@"optionalForeignMessage"]);
2464 XCTAssertNotNil([message valueForKeyPath:@"optionalImportMessage"]);
2465 XCTAssertEqualObjects([message valueForKeyPath:@"optionalGroup.hasA"], @NO);
2467 [message valueForKeyPath:@"optionalNestedMessage.hasBb"], @NO);
2469 [message valueForKeyPath:@"optionalForeignMessage.hasC"], @NO);
2470 XCTAssertEqualObjects([message valueForKeyPath:@"optionalImportMessage.hasD"],
2473 XCTAssertEqualObjects([message valueForKeyPath:@"optionalGroup.a"], @0);
2474 XCTAssertEqualObjects([message valueForKeyPath:@"optionalNestedMessage.bb"],
2476 XCTAssertEqualObjects([message valueForKeyPath:@"optionalForeignMessage.c"],
2478 XCTAssertEqualObjects([message valueForKeyPath:@"optionalImportMessage.d"],
2482 XCTAssertEqualObjects([message valueForKey:@"optionalNestedEnum"],
2484 XCTAssertEqualObjects([message valueForKey:@"optionalForeignEnum"],
2486 XCTAssertEqualObjects([message valueForKey:@"optionalImportEnum"],
2489 XCTAssertEqualObjects([message valueForKey:@"optionalStringPiece"], @"");
2490 XCTAssertEqualObjects([message valueForKey:@"optionalCord"], @"");
2494 XCTAssertEqualObjects([message valueForKey:@"hasDefaultInt32"], @NO);
2495 XCTAssertEqualObjects([message valueForKey:@"hasDefaultInt64"], @NO);
2496 XCTAssertEqualObjects([message valueForKey:@"hasDefaultUint32"], @NO);
2497 XCTAssertEqualObjects([message valueForKey:@"hasDefaultUint64"], @NO);
2498 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSint32"], @NO);
2499 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSint64"], @NO);
2500 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFixed32"], @NO);
2501 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFixed64"], @NO);
2502 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSfixed32"], @NO);
2503 XCTAssertEqualObjects([message valueForKey:@"hasDefaultSfixed64"], @NO);
2504 XCTAssertEqualObjects([message valueForKey:@"hasDefaultFloat"], @NO);
2505 XCTAssertEqualObjects([message valueForKey:@"hasDefaultDouble"], @NO);
2506 XCTAssertEqualObjects([message valueForKey:@"hasDefaultBool"], @NO);
2507 XCTAssertEqualObjects([message valueForKey:@"hasDefaultString"], @NO);
2508 XCTAssertEqualObjects([message valueForKey:@"hasDefaultBytes"], @NO);
2510 XCTAssertEqualObjects([message valueForKey:@"hasDefaultNestedEnum"], @NO);
2511 XCTAssertEqualObjects([message valueForKey:@"hasDefaultForeignEnum"], @NO);
2512 XCTAssertEqualObjects([message valueForKey:@"hasDefaultImportEnum"], @NO);
2514 XCTAssertEqualObjects([message valueForKey:@"hasDefaultStringPiece"], @NO);
2515 XCTAssertEqualObjects([message valueForKey:@"hasDefaultCord"], @NO);
2518 XCTAssertEqualObjects([message valueForKey:@"defaultInt32"], @41);
2519 XCTAssertEqualObjects([message valueForKey:@"defaultInt64"], @42);
2520 XCTAssertEqualObjects([message valueForKey:@"defaultUint32"], @43);
2521 XCTAssertEqualObjects([message valueForKey:@"defaultUint64"], @44);
2522 XCTAssertEqualObjects([message valueForKey:@"defaultSint32"], @-45);
2523 XCTAssertEqualObjects([message valueForKey:@"defaultSint64"], @46);
2524 XCTAssertEqualObjects([message valueForKey:@"defaultFixed32"], @47);
2525 XCTAssertEqualObjects([message valueForKey:@"defaultFixed64"], @48);
2526 XCTAssertEqualObjects([message valueForKey:@"defaultSfixed32"], @49);
2527 XCTAssertEqualObjects([message valueForKey:@"defaultSfixed64"], @-50);
2528 XCTAssertEqualObjects([message valueForKey:@"defaultFloat"], @51.5);
2529 XCTAssertEqualObjects([message valueForKey:@"defaultDouble"], @52e3);
2530 XCTAssertEqualObjects([message valueForKey:@"defaultBool"], @YES);
2531 XCTAssertEqualObjects([message valueForKey:@"defaultString"], @"hello");
2532 XCTAssertEqualObjects([message valueForKey:@"defaultBytes"],
2535 XCTAssertEqualObjects([message valueForKey:@"defaultNestedEnum"],
2537 XCTAssertEqualObjects([message valueForKey:@"defaultForeignEnum"],
2539 XCTAssertEqualObjects([message valueForKey:@"defaultImportEnum"],
2542 XCTAssertEqualObjects([message valueForKey:@"defaultStringPiece"], @"abc");
2543 XCTAssertEqualObjects([message valueForKey:@"defaultCord"], @"123");