Lines Matching full:dict

86   GPBInt32UInt32Dictionary *dict = [[GPBInt32UInt32Dictionary alloc] init];
87 XCTAssertNotNil(dict);
88 XCTAssertEqual(dict.count, 0U);
89 XCTAssertFalse([dict getUInt32:NULL forKey:11]);
90 [dict enumerateKeysAndUInt32sUsingBlock:^(int32_t aKey, uint32_t aValue, BOOL *stop) {
94 [dict release];
98 GPBInt32UInt32Dictionary *dict = [[GPBInt32UInt32Dictionary alloc] init];
99 [dict setUInt32:100U forKey:11];
100 XCTAssertNotNil(dict);
101 XCTAssertEqual(dict.count, 1U);
103 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
104 XCTAssertTrue([dict getUInt32:&value forKey:11]);
106 XCTAssertFalse([dict getUInt32:NULL forKey:12]);
107 [dict enumerateKeysAndUInt32sUsingBlock:^(int32_t aKey, uint32_t aValue, BOOL *stop) {
112 [dict release];
118 GPBInt32UInt32Dictionary *dict =
122 XCTAssertNotNil(dict);
123 XCTAssertEqual(dict.count, 3U);
125 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
126 XCTAssertTrue([dict getUInt32:&value forKey:11]);
128 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
129 XCTAssertTrue([dict getUInt32:&value forKey:12]);
131 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
132 XCTAssertTrue([dict getUInt32:&value forKey:13]);
134 XCTAssertFalse([dict getUInt32:NULL forKey:14]);
139 [dict enumerateKeysAndUInt32sUsingBlock:^(int32_t aKey, uint32_t aValue, BOOL *stop) {
161 [dict enumerateKeysAndUInt32sUsingBlock:^(int32_t aKey, uint32_t aValue, BOOL *stop) {
167 [dict release];
227 GPBInt32UInt32Dictionary *dict =
231 XCTAssertNotNil(dict);
233 GPBInt32UInt32Dictionary *dict2 = [dict copy];
237 XCTAssertNotEqual(dict, dict2);
238 XCTAssertEqualObjects(dict, dict2);
242 [dict release];
248 GPBInt32UInt32Dictionary *dict =
252 XCTAssertNotNil(dict);
255 [[GPBInt32UInt32Dictionary alloc] initWithDictionary:dict];
259 XCTAssertNotEqual(dict, dict2);
260 XCTAssertEqualObjects(dict, dict2);
262 [dict release];
266 GPBInt32UInt32Dictionary *dict = [[GPBInt32UInt32Dictionary alloc] init];
267 XCTAssertNotNil(dict);
269 XCTAssertEqual(dict.count, 0U);
270 [dict setUInt32:100U forKey:11];
271 XCTAssertEqual(dict.count, 1U);
280 [dict addEntriesFromDictionary:dict2];
281 XCTAssertEqual(dict.count, 4U);
284 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
285 XCTAssertTrue([dict getUInt32:&value forKey:11]);
287 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
288 XCTAssertTrue([dict getUInt32:&value forKey:12]);
290 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
291 XCTAssertTrue([dict getUInt32:&value forKey:13]);
293 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
294 XCTAssertTrue([dict getUInt32:&value forKey:14]);
297 [dict release];
303 GPBInt32UInt32Dictionary *dict =
307 XCTAssertNotNil(dict);
308 XCTAssertEqual(dict.count, 4U);
310 [dict removeUInt32ForKey:12];
311 XCTAssertEqual(dict.count, 3U);
313 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
314 XCTAssertTrue([dict getUInt32:&value forKey:11]);
316 XCTAssertFalse([dict getUInt32:NULL forKey:12]);
317 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
318 XCTAssertTrue([dict getUInt32:&value forKey:13]);
320 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
321 XCTAssertTrue([dict getUInt32:&value forKey:14]);
325 [dict removeUInt32ForKey:12];
326 XCTAssertEqual(dict.count, 3U);
327 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
328 XCTAssertTrue([dict getUInt32:&value forKey:11]);
330 XCTAssertFalse([dict getUInt32:NULL forKey:12]);
331 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
332 XCTAssertTrue([dict getUInt32:&value forKey:13]);
334 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
335 XCTAssertTrue([dict getUInt32:&value forKey:14]);
338 [dict removeUInt32ForKey:14];
339 XCTAssertEqual(dict.count, 2U);
340 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
341 XCTAssertTrue([dict getUInt32:&value forKey:11]);
343 XCTAssertFalse([dict getUInt32:NULL forKey:12]);
344 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
345 XCTAssertTrue([dict getUInt32:&value forKey:13]);
347 XCTAssertFalse([dict getUInt32:NULL forKey:14]);
349 [dict removeAll];
350 XCTAssertEqual(dict.count, 0U);
351 XCTAssertFalse([dict getUInt32:NULL forKey:11]);
352 XCTAssertFalse([dict getUInt32:NULL forKey:12]);
353 XCTAssertFalse([dict getUInt32:NULL forKey:13]);
354 XCTAssertFalse([dict getUInt32:NULL forKey:14]);
355 [dict release];
361 GPBInt32UInt32Dictionary *dict =
365 XCTAssertNotNil(dict);
366 XCTAssertEqual(dict.count, 4U);
368 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
369 XCTAssertTrue([dict getUInt32:&value forKey:11]);
371 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
372 XCTAssertTrue([dict getUInt32:&value forKey:12]);
374 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
375 XCTAssertTrue([dict getUInt32:&value forKey:13]);
377 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
378 XCTAssertTrue([dict getUInt32:&value forKey:14]);
381 [dict setUInt32:103U forKey:11];
382 XCTAssertEqual(dict.count, 4U);
383 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
384 XCTAssertTrue([dict getUInt32:&value forKey:11]);
386 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
387 XCTAssertTrue([dict getUInt32:&value forKey:12]);
389 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
390 XCTAssertTrue([dict getUInt32:&value forKey:13]);
392 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
393 XCTAssertTrue([dict getUInt32:&value forKey:14]);
396 [dict setUInt32:101U forKey:14];
397 XCTAssertEqual(dict.count, 4U);
398 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
399 XCTAssertTrue([dict getUInt32:&value forKey:11]);
401 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
402 XCTAssertTrue([dict getUInt32:&value forKey:12]);
404 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
405 XCTAssertTrue([dict getUInt32:&value forKey:13]);
407 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
408 XCTAssertTrue([dict getUInt32:&value forKey:14]);
418 [dict addEntriesFromDictionary:dict2];
419 XCTAssertEqual(dict.count, 4U);
420 XCTAssertTrue([dict getUInt32:NULL forKey:11]);
421 XCTAssertTrue([dict getUInt32:&value forKey:11]);
423 XCTAssertTrue([dict getUInt32:NULL forKey:12]);
424 XCTAssertTrue([dict getUInt32:&value forKey:12]);
426 XCTAssertTrue([dict getUInt32:NULL forKey:13]);
427 XCTAssertTrue([dict getUInt32:&value forKey:13]);
429 XCTAssertTrue([dict getUInt32:NULL forKey:14]);
430 XCTAssertTrue([dict getUInt32:&value forKey:14]);
434 [dict release];
447 GPBInt32Int32Dictionary *dict = [[GPBInt32Int32Dictionary alloc] init];
448 XCTAssertNotNil(dict);
449 XCTAssertEqual(dict.count, 0U);
450 XCTAssertFalse([dict getInt32:NULL forKey:11]);
451 [dict enumerateKeysAndInt32sUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
455 [dict release];
459 GPBInt32Int32Dictionary *dict = [[GPBInt32Int32Dictionary alloc] init];
460 [dict setInt32:200 forKey:11];
461 XCTAssertNotNil(dict);
462 XCTAssertEqual(dict.count, 1U);
464 XCTAssertTrue([dict getInt32:NULL forKey:11]);
465 XCTAssertTrue([dict getInt32:&value forKey:11]);
467 XCTAssertFalse([dict getInt32:NULL forKey:12]);
468 [dict enumerateKeysAndInt32sUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
473 [dict release];
479 GPBInt32Int32Dictionary *dict =
483 XCTAssertNotNil(dict);
484 XCTAssertEqual(dict.count, 3U);
486 XCTAssertTrue([dict getInt32:NULL forKey:11]);
487 XCTAssertTrue([dict getInt32:&value forKey:11]);
489 XCTAssertTrue([dict getInt32:NULL forKey:12]);
490 XCTAssertTrue([dict getInt32:&value forKey:12]);
492 XCTAssertTrue([dict getInt32:NULL forKey:13]);
493 XCTAssertTrue([dict getInt32:&value forKey:13]);
495 XCTAssertFalse([dict getInt32:NULL forKey:14]);
500 [dict enumerateKeysAndInt32sUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
522 [dict enumerateKeysAndInt32sUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
528 [dict release];
588 GPBInt32Int32Dictionary *dict =
592 XCTAssertNotNil(dict);
594 GPBInt32Int32Dictionary *dict2 = [dict copy];
598 XCTAssertNotEqual(dict, dict2);
599 XCTAssertEqualObjects(dict, dict2);
603 [dict release];
609 GPBInt32Int32Dictionary *dict =
613 XCTAssertNotNil(dict);
616 [[GPBInt32Int32Dictionary alloc] initWithDictionary:dict];
620 XCTAssertNotEqual(dict, dict2);
621 XCTAssertEqualObjects(dict, dict2);
623 [dict release];
627 GPBInt32Int32Dictionary *dict = [[GPBInt32Int32Dictionary alloc] init];
628 XCTAssertNotNil(dict);
630 XCTAssertEqual(dict.count, 0U);
631 [dict setInt32:200 forKey:11];
632 XCTAssertEqual(dict.count, 1U);
641 [dict addEntriesFromDictionary:dict2];
642 XCTAssertEqual(dict.count, 4U);
645 XCTAssertTrue([dict getInt32:NULL forKey:11]);
646 XCTAssertTrue([dict getInt32:&value forKey:11]);
648 XCTAssertTrue([dict getInt32:NULL forKey:12]);
649 XCTAssertTrue([dict getInt32:&value forKey:12]);
651 XCTAssertTrue([dict getInt32:NULL forKey:13]);
652 XCTAssertTrue([dict getInt32:&value forKey:13]);
654 XCTAssertTrue([dict getInt32:NULL forKey:14]);
655 XCTAssertTrue([dict getInt32:&value forKey:14]);
658 [dict release];
664 GPBInt32Int32Dictionary *dict =
668 XCTAssertNotNil(dict);
669 XCTAssertEqual(dict.count, 4U);
671 [dict removeInt32ForKey:12];
672 XCTAssertEqual(dict.count, 3U);
674 XCTAssertTrue([dict getInt32:NULL forKey:11]);
675 XCTAssertTrue([dict getInt32:&value forKey:11]);
677 XCTAssertFalse([dict getInt32:NULL forKey:12]);
678 XCTAssertTrue([dict getInt32:NULL forKey:13]);
679 XCTAssertTrue([dict getInt32:&value forKey:13]);
681 XCTAssertTrue([dict getInt32:NULL forKey:14]);
682 XCTAssertTrue([dict getInt32:&value forKey:14]);
686 [dict removeInt32ForKey:12];
687 XCTAssertEqual(dict.count, 3U);
688 XCTAssertTrue([dict getInt32:NULL forKey:11]);
689 XCTAssertTrue([dict getInt32:&value forKey:11]);
691 XCTAssertFalse([dict getInt32:NULL forKey:12]);
692 XCTAssertTrue([dict getInt32:NULL forKey:13]);
693 XCTAssertTrue([dict getInt32:&value forKey:13]);
695 XCTAssertTrue([dict getInt32:NULL forKey:14]);
696 XCTAssertTrue([dict getInt32:&value forKey:14]);
699 [dict removeInt32ForKey:14];
700 XCTAssertEqual(dict.count, 2U);
701 XCTAssertTrue([dict getInt32:NULL forKey:11]);
702 XCTAssertTrue([dict getInt32:&value forKey:11]);
704 XCTAssertFalse([dict getInt32:NULL forKey:12]);
705 XCTAssertTrue([dict getInt32:NULL forKey:13]);
706 XCTAssertTrue([dict getInt32:&value forKey:13]);
708 XCTAssertFalse([dict getInt32:NULL forKey:14]);
710 [dict removeAll];
711 XCTAssertEqual(dict.count, 0U);
712 XCTAssertFalse([dict getInt32:NULL forKey:11]);
713 XCTAssertFalse([dict getInt32:NULL forKey:12]);
714 XCTAssertFalse([dict getInt32:NULL forKey:13]);
715 XCTAssertFalse([dict getInt32:NULL forKey:14]);
716 [dict release];
722 GPBInt32Int32Dictionary *dict =
726 XCTAssertNotNil(dict);
727 XCTAssertEqual(dict.count, 4U);
729 XCTAssertTrue([dict getInt32:NULL forKey:11]);
730 XCTAssertTrue([dict getInt32:&value forKey:11]);
732 XCTAssertTrue([dict getInt32:NULL forKey:12]);
733 XCTAssertTrue([dict getInt32:&value forKey:12]);
735 XCTAssertTrue([dict getInt32:NULL forKey:13]);
736 XCTAssertTrue([dict getInt32:&value forKey:13]);
738 XCTAssertTrue([dict getInt32:NULL forKey:14]);
739 XCTAssertTrue([dict getInt32:&value forKey:14]);
742 [dict setInt32:203 forKey:11];
743 XCTAssertEqual(dict.count, 4U);
744 XCTAssertTrue([dict getInt32:NULL forKey:11]);
745 XCTAssertTrue([dict getInt32:&value forKey:11]);
747 XCTAssertTrue([dict getInt32:NULL forKey:12]);
748 XCTAssertTrue([dict getInt32:&value forKey:12]);
750 XCTAssertTrue([dict getInt32:NULL forKey:13]);
751 XCTAssertTrue([dict getInt32:&value forKey:13]);
753 XCTAssertTrue([dict getInt32:NULL forKey:14]);
754 XCTAssertTrue([dict getInt32:&value forKey:14]);
757 [dict setInt32:201 forKey:14];
758 XCTAssertEqual(dict.count, 4U);
759 XCTAssertTrue([dict getInt32:NULL forKey:11]);
760 XCTAssertTrue([dict getInt32:&value forKey:11]);
762 XCTAssertTrue([dict getInt32:NULL forKey:12]);
763 XCTAssertTrue([dict getInt32:&value forKey:12]);
765 XCTAssertTrue([dict getInt32:NULL forKey:13]);
766 XCTAssertTrue([dict getInt32:&value forKey:13]);
768 XCTAssertTrue([dict getInt32:NULL forKey:14]);
769 XCTAssertTrue([dict getInt32:&value forKey:14]);
779 [dict addEntriesFromDictionary:dict2];
780 XCTAssertEqual(dict.count, 4U);
781 XCTAssertTrue([dict getInt32:NULL forKey:11]);
782 XCTAssertTrue([dict getInt32:&value forKey:11]);
784 XCTAssertTrue([dict getInt32:NULL forKey:12]);
785 XCTAssertTrue([dict getInt32:&value forKey:12]);
787 XCTAssertTrue([dict getInt32:NULL forKey:13]);
788 XCTAssertTrue([dict getInt32:&value forKey:13]);
790 XCTAssertTrue([dict getInt32:NULL forKey:14]);
791 XCTAssertTrue([dict getInt32:&value forKey:14]);
795 [dict release];
808 GPBInt32UInt64Dictionary *dict = [[GPBInt32UInt64Dictionary alloc] init];
809 XCTAssertNotNil(dict);
810 XCTAssertEqual(dict.count, 0U);
811 XCTAssertFalse([dict getUInt64:NULL forKey:11]);
812 [dict enumerateKeysAndUInt64sUsingBlock:^(int32_t aKey, uint64_t aValue, BOOL *stop) {
816 [dict release];
820 GPBInt32UInt64Dictionary *dict = [[GPBInt32UInt64Dictionary alloc] init];
821 [dict setUInt64:300U forKey:11];
822 XCTAssertNotNil(dict);
823 XCTAssertEqual(dict.count, 1U);
825 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
826 XCTAssertTrue([dict getUInt64:&value forKey:11]);
828 XCTAssertFalse([dict getUInt64:NULL forKey:12]);
829 [dict enumerateKeysAndUInt64sUsingBlock:^(int32_t aKey, uint64_t aValue, BOOL *stop) {
834 [dict release];
840 GPBInt32UInt64Dictionary *dict =
844 XCTAssertNotNil(dict);
845 XCTAssertEqual(dict.count, 3U);
847 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
848 XCTAssertTrue([dict getUInt64:&value forKey:11]);
850 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
851 XCTAssertTrue([dict getUInt64:&value forKey:12]);
853 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
854 XCTAssertTrue([dict getUInt64:&value forKey:13]);
856 XCTAssertFalse([dict getUInt64:NULL forKey:14]);
861 [dict enumerateKeysAndUInt64sUsingBlock:^(int32_t aKey, uint64_t aValue, BOOL *stop) {
883 [dict enumerateKeysAndUInt64sUsingBlock:^(int32_t aKey, uint64_t aValue, BOOL *stop) {
889 [dict release];
949 GPBInt32UInt64Dictionary *dict =
953 XCTAssertNotNil(dict);
955 GPBInt32UInt64Dictionary *dict2 = [dict copy];
959 XCTAssertNotEqual(dict, dict2);
960 XCTAssertEqualObjects(dict, dict2);
964 [dict release];
970 GPBInt32UInt64Dictionary *dict =
974 XCTAssertNotNil(dict);
977 [[GPBInt32UInt64Dictionary alloc] initWithDictionary:dict];
981 XCTAssertNotEqual(dict, dict2);
982 XCTAssertEqualObjects(dict, dict2);
984 [dict release];
988 GPBInt32UInt64Dictionary *dict = [[GPBInt32UInt64Dictionary alloc] init];
989 XCTAssertNotNil(dict);
991 XCTAssertEqual(dict.count, 0U);
992 [dict setUInt64:300U forKey:11];
993 XCTAssertEqual(dict.count, 1U);
1002 [dict addEntriesFromDictionary:dict2];
1003 XCTAssertEqual(dict.count, 4U);
1006 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1007 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1009 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
1010 XCTAssertTrue([dict getUInt64:&value forKey:12]);
1012 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1013 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1015 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1016 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1019 [dict release];
1025 GPBInt32UInt64Dictionary *dict =
1029 XCTAssertNotNil(dict);
1030 XCTAssertEqual(dict.count, 4U);
1032 [dict removeUInt64ForKey:12];
1033 XCTAssertEqual(dict.count, 3U);
1035 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1036 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1038 XCTAssertFalse([dict getUInt64:NULL forKey:12]);
1039 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1040 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1042 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1043 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1047 [dict removeUInt64ForKey:12];
1048 XCTAssertEqual(dict.count, 3U);
1049 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1050 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1052 XCTAssertFalse([dict getUInt64:NULL forKey:12]);
1053 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1054 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1056 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1057 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1060 [dict removeUInt64ForKey:14];
1061 XCTAssertEqual(dict.count, 2U);
1062 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1063 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1065 XCTAssertFalse([dict getUInt64:NULL forKey:12]);
1066 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1067 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1069 XCTAssertFalse([dict getUInt64:NULL forKey:14]);
1071 [dict removeAll];
1072 XCTAssertEqual(dict.count, 0U);
1073 XCTAssertFalse([dict getUInt64:NULL forKey:11]);
1074 XCTAssertFalse([dict getUInt64:NULL forKey:12]);
1075 XCTAssertFalse([dict getUInt64:NULL forKey:13]);
1076 XCTAssertFalse([dict getUInt64:NULL forKey:14]);
1077 [dict release];
1083 GPBInt32UInt64Dictionary *dict =
1087 XCTAssertNotNil(dict);
1088 XCTAssertEqual(dict.count, 4U);
1090 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1091 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1093 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
1094 XCTAssertTrue([dict getUInt64:&value forKey:12]);
1096 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1097 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1099 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1100 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1103 [dict setUInt64:303U forKey:11];
1104 XCTAssertEqual(dict.count, 4U);
1105 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1106 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1108 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
1109 XCTAssertTrue([dict getUInt64:&value forKey:12]);
1111 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1112 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1114 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1115 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1118 [dict setUInt64:301U forKey:14];
1119 XCTAssertEqual(dict.count, 4U);
1120 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1121 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1123 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
1124 XCTAssertTrue([dict getUInt64:&value forKey:12]);
1126 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1127 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1129 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1130 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1140 [dict addEntriesFromDictionary:dict2];
1141 XCTAssertEqual(dict.count, 4U);
1142 XCTAssertTrue([dict getUInt64:NULL forKey:11]);
1143 XCTAssertTrue([dict getUInt64:&value forKey:11]);
1145 XCTAssertTrue([dict getUInt64:NULL forKey:12]);
1146 XCTAssertTrue([dict getUInt64:&value forKey:12]);
1148 XCTAssertTrue([dict getUInt64:NULL forKey:13]);
1149 XCTAssertTrue([dict getUInt64:&value forKey:13]);
1151 XCTAssertTrue([dict getUInt64:NULL forKey:14]);
1152 XCTAssertTrue([dict getUInt64:&value forKey:14]);
1156 [dict release];
1169 GPBInt32Int64Dictionary *dict = [[GPBInt32Int64Dictionary alloc] init];
1170 XCTAssertNotNil(dict);
1171 XCTAssertEqual(dict.count, 0U);
1172 XCTAssertFalse([dict getInt64:NULL forKey:11]);
1173 [dict enumerateKeysAndInt64sUsingBlock:^(int32_t aKey, int64_t aValue, BOOL *stop) {
1177 [dict release];
1181 GPBInt32Int64Dictionary *dict = [[GPBInt32Int64Dictionary alloc] init];
1182 [dict setInt64:400 forKey:11];
1183 XCTAssertNotNil(dict);
1184 XCTAssertEqual(dict.count, 1U);
1186 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1187 XCTAssertTrue([dict getInt64:&value forKey:11]);
1189 XCTAssertFalse([dict getInt64:NULL forKey:12]);
1190 [dict enumerateKeysAndInt64sUsingBlock:^(int32_t aKey, int64_t aValue, BOOL *stop) {
1195 [dict release];
1201 GPBInt32Int64Dictionary *dict =
1205 XCTAssertNotNil(dict);
1206 XCTAssertEqual(dict.count, 3U);
1208 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1209 XCTAssertTrue([dict getInt64:&value forKey:11]);
1211 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1212 XCTAssertTrue([dict getInt64:&value forKey:12]);
1214 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1215 XCTAssertTrue([dict getInt64:&value forKey:13]);
1217 XCTAssertFalse([dict getInt64:NULL forKey:14]);
1222 [dict enumerateKeysAndInt64sUsingBlock:^(int32_t aKey, int64_t aValue, BOOL *stop) {
1244 [dict enumerateKeysAndInt64sUsingBlock:^(int32_t aKey, int64_t aValue, BOOL *stop) {
1250 [dict release];
1310 GPBInt32Int64Dictionary *dict =
1314 XCTAssertNotNil(dict);
1316 GPBInt32Int64Dictionary *dict2 = [dict copy];
1320 XCTAssertNotEqual(dict, dict2);
1321 XCTAssertEqualObjects(dict, dict2);
1325 [dict release];
1331 GPBInt32Int64Dictionary *dict =
1335 XCTAssertNotNil(dict);
1338 [[GPBInt32Int64Dictionary alloc] initWithDictionary:dict];
1342 XCTAssertNotEqual(dict, dict2);
1343 XCTAssertEqualObjects(dict, dict2);
1345 [dict release];
1349 GPBInt32Int64Dictionary *dict = [[GPBInt32Int64Dictionary alloc] init];
1350 XCTAssertNotNil(dict);
1352 XCTAssertEqual(dict.count, 0U);
1353 [dict setInt64:400 forKey:11];
1354 XCTAssertEqual(dict.count, 1U);
1363 [dict addEntriesFromDictionary:dict2];
1364 XCTAssertEqual(dict.count, 4U);
1367 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1368 XCTAssertTrue([dict getInt64:&value forKey:11]);
1370 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1371 XCTAssertTrue([dict getInt64:&value forKey:12]);
1373 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1374 XCTAssertTrue([dict getInt64:&value forKey:13]);
1376 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1377 XCTAssertTrue([dict getInt64:&value forKey:14]);
1380 [dict release];
1386 GPBInt32Int64Dictionary *dict =
1390 XCTAssertNotNil(dict);
1391 XCTAssertEqual(dict.count, 4U);
1393 [dict removeInt64ForKey:12];
1394 XCTAssertEqual(dict.count, 3U);
1396 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1397 XCTAssertTrue([dict getInt64:&value forKey:11]);
1399 XCTAssertFalse([dict getInt64:NULL forKey:12]);
1400 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1401 XCTAssertTrue([dict getInt64:&value forKey:13]);
1403 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1404 XCTAssertTrue([dict getInt64:&value forKey:14]);
1408 [dict removeInt64ForKey:12];
1409 XCTAssertEqual(dict.count, 3U);
1410 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1411 XCTAssertTrue([dict getInt64:&value forKey:11]);
1413 XCTAssertFalse([dict getInt64:NULL forKey:12]);
1414 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1415 XCTAssertTrue([dict getInt64:&value forKey:13]);
1417 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1418 XCTAssertTrue([dict getInt64:&value forKey:14]);
1421 [dict removeInt64ForKey:14];
1422 XCTAssertEqual(dict.count, 2U);
1423 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1424 XCTAssertTrue([dict getInt64:&value forKey:11]);
1426 XCTAssertFalse([dict getInt64:NULL forKey:12]);
1427 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1428 XCTAssertTrue([dict getInt64:&value forKey:13]);
1430 XCTAssertFalse([dict getInt64:NULL forKey:14]);
1432 [dict removeAll];
1433 XCTAssertEqual(dict.count, 0U);
1434 XCTAssertFalse([dict getInt64:NULL forKey:11]);
1435 XCTAssertFalse([dict getInt64:NULL forKey:12]);
1436 XCTAssertFalse([dict getInt64:NULL forKey:13]);
1437 XCTAssertFalse([dict getInt64:NULL forKey:14]);
1438 [dict release];
1444 GPBInt32Int64Dictionary *dict =
1448 XCTAssertNotNil(dict);
1449 XCTAssertEqual(dict.count, 4U);
1451 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1452 XCTAssertTrue([dict getInt64:&value forKey:11]);
1454 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1455 XCTAssertTrue([dict getInt64:&value forKey:12]);
1457 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1458 XCTAssertTrue([dict getInt64:&value forKey:13]);
1460 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1461 XCTAssertTrue([dict getInt64:&value forKey:14]);
1464 [dict setInt64:403 forKey:11];
1465 XCTAssertEqual(dict.count, 4U);
1466 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1467 XCTAssertTrue([dict getInt64:&value forKey:11]);
1469 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1470 XCTAssertTrue([dict getInt64:&value forKey:12]);
1472 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1473 XCTAssertTrue([dict getInt64:&value forKey:13]);
1475 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1476 XCTAssertTrue([dict getInt64:&value forKey:14]);
1479 [dict setInt64:401 forKey:14];
1480 XCTAssertEqual(dict.count, 4U);
1481 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1482 XCTAssertTrue([dict getInt64:&value forKey:11]);
1484 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1485 XCTAssertTrue([dict getInt64:&value forKey:12]);
1487 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1488 XCTAssertTrue([dict getInt64:&value forKey:13]);
1490 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1491 XCTAssertTrue([dict getInt64:&value forKey:14]);
1501 [dict addEntriesFromDictionary:dict2];
1502 XCTAssertEqual(dict.count, 4U);
1503 XCTAssertTrue([dict getInt64:NULL forKey:11]);
1504 XCTAssertTrue([dict getInt64:&value forKey:11]);
1506 XCTAssertTrue([dict getInt64:NULL forKey:12]);
1507 XCTAssertTrue([dict getInt64:&value forKey:12]);
1509 XCTAssertTrue([dict getInt64:NULL forKey:13]);
1510 XCTAssertTrue([dict getInt64:&value forKey:13]);
1512 XCTAssertTrue([dict getInt64:NULL forKey:14]);
1513 XCTAssertTrue([dict getInt64:&value forKey:14]);
1517 [dict release];
1530 GPBInt32BoolDictionary *dict = [[GPBInt32BoolDictionary alloc] init];
1531 XCTAssertNotNil(dict);
1532 XCTAssertEqual(dict.count, 0U);
1533 XCTAssertFalse([dict getBool:NULL forKey:11]);
1534 [dict enumerateKeysAndBoolsUsingBlock:^(int32_t aKey, BOOL aValue, BOOL *stop) {
1538 [dict release];
1542 GPBInt32BoolDictionary *dict = [[GPBInt32BoolDictionary alloc] init];
1543 [dict setBool:YES forKey:11];
1544 XCTAssertNotNil(dict);
1545 XCTAssertEqual(dict.count, 1U);
1547 XCTAssertTrue([dict getBool:NULL forKey:11]);
1548 XCTAssertTrue([dict getBool:&value forKey:11]);
1550 XCTAssertFalse([dict getBool:NULL forKey:12]);
1551 [dict enumerateKeysAndBoolsUsingBlock:^(int32_t aKey, BOOL aValue, BOOL *stop) {
1556 [dict release];
1562 GPBInt32BoolDictionary *dict =
1566 XCTAssertNotNil(dict);
1567 XCTAssertEqual(dict.count, 3U);
1569 XCTAssertTrue([dict getBool:NULL forKey:11]);
1570 XCTAssertTrue([dict getBool:&value forKey:11]);
1572 XCTAssertTrue([dict getBool:NULL forKey:12]);
1573 XCTAssertTrue([dict getBool:&value forKey:12]);
1575 XCTAssertTrue([dict getBool:NULL forKey:13]);
1576 XCTAssertTrue([dict getBool:&value forKey:13]);
1578 XCTAssertFalse([dict getBool:NULL forKey:14]);
1583 [dict enumerateKeysAndBoolsUsingBlock:^(int32_t aKey, BOOL aValue, BOOL *stop) {
1605 [dict enumerateKeysAndBoolsUsingBlock:^(int32_t aKey, BOOL aValue, BOOL *stop) {
1611 [dict release];
1671 GPBInt32BoolDictionary *dict =
1675 XCTAssertNotNil(dict);
1677 GPBInt32BoolDictionary *dict2 = [dict copy];
1681 XCTAssertNotEqual(dict, dict2);
1682 XCTAssertEqualObjects(dict, dict2);
1686 [dict release];
1692 GPBInt32BoolDictionary *dict =
1696 XCTAssertNotNil(dict);
1699 [[GPBInt32BoolDictionary alloc] initWithDictionary:dict];
1703 XCTAssertNotEqual(dict, dict2);
1704 XCTAssertEqualObjects(dict, dict2);
1706 [dict release];
1710 GPBInt32BoolDictionary *dict = [[GPBInt32BoolDictionary alloc] init];
1711 XCTAssertNotNil(dict);
1713 XCTAssertEqual(dict.count, 0U);
1714 [dict setBool:YES forKey:11];
1715 XCTAssertEqual(dict.count, 1U);
1724 [dict addEntriesFromDictionary:dict2];
1725 XCTAssertEqual(dict.count, 4U);
1728 XCTAssertTrue([dict getBool:NULL forKey:11]);
1729 XCTAssertTrue([dict getBool:&value forKey:11]);
1731 XCTAssertTrue([dict getBool:NULL forKey:12]);
1732 XCTAssertTrue([dict getBool:&value forKey:12]);
1734 XCTAssertTrue([dict getBool:NULL forKey:13]);
1735 XCTAssertTrue([dict getBool:&value forKey:13]);
1737 XCTAssertTrue([dict getBool:NULL forKey:14]);
1738 XCTAssertTrue([dict getBool:&value forKey:14]);
1741 [dict release];
1747 GPBInt32BoolDictionary *dict =
1751 XCTAssertNotNil(dict);
1752 XCTAssertEqual(dict.count, 4U);
1754 [dict removeBoolForKey:12];
1755 XCTAssertEqual(dict.count, 3U);
1757 XCTAssertTrue([dict getBool:NULL forKey:11]);
1758 XCTAssertTrue([dict getBool:&value forKey:11]);
1760 XCTAssertFalse([dict getBool:NULL forKey:12]);
1761 XCTAssertTrue([dict getBool:NULL forKey:13]);
1762 XCTAssertTrue([dict getBool:&value forKey:13]);
1764 XCTAssertTrue([dict getBool:NULL forKey:14]);
1765 XCTAssertTrue([dict getBool:&value forKey:14]);
1769 [dict removeBoolForKey:12];
1770 XCTAssertEqual(dict.count, 3U);
1771 XCTAssertTrue([dict getBool:NULL forKey:11]);
1772 XCTAssertTrue([dict getBool:&value forKey:11]);
1774 XCTAssertFalse([dict getBool:NULL forKey:12]);
1775 XCTAssertTrue([dict getBool:NULL forKey:13]);
1776 XCTAssertTrue([dict getBool:&value forKey:13]);
1778 XCTAssertTrue([dict getBool:NULL forKey:14]);
1779 XCTAssertTrue([dict getBool:&value forKey:14]);
1782 [dict removeBoolForKey:14];
1783 XCTAssertEqual(dict.count, 2U);
1784 XCTAssertTrue([dict getBool:NULL forKey:11]);
1785 XCTAssertTrue([dict getBool:&value forKey:11]);
1787 XCTAssertFalse([dict getBool:NULL forKey:12]);
1788 XCTAssertTrue([dict getBool:NULL forKey:13]);
1789 XCTAssertTrue([dict getBool:&value forKey:13]);
1791 XCTAssertFalse([dict getBool:NULL forKey:14]);
1793 [dict removeAll];
1794 XCTAssertEqual(dict.count, 0U);
1795 XCTAssertFalse([dict getBool:NULL forKey:11]);
1796 XCTAssertFalse([dict getBool:NULL forKey:12]);
1797 XCTAssertFalse([dict getBool:NULL forKey:13]);
1798 XCTAssertFalse([dict getBool:NULL forKey:14]);
1799 [dict release];
1805 GPBInt32BoolDictionary *dict =
1809 XCTAssertNotNil(dict);
1810 XCTAssertEqual(dict.count, 4U);
1812 XCTAssertTrue([dict getBool:NULL forKey:11]);
1813 XCTAssertTrue([dict getBool:&value forKey:11]);
1815 XCTAssertTrue([dict getBool:NULL forKey:12]);
1816 XCTAssertTrue([dict getBool:&value forKey:12]);
1818 XCTAssertTrue([dict getBool:NULL forKey:13]);
1819 XCTAssertTrue([dict getBool:&value forKey:13]);
1821 XCTAssertTrue([dict getBool:NULL forKey:14]);
1822 XCTAssertTrue([dict getBool:&value forKey:14]);
1825 [dict setBool:NO forKey:11];
1826 XCTAssertEqual(dict.count, 4U);
1827 XCTAssertTrue([dict getBool:NULL forKey:11]);
1828 XCTAssertTrue([dict getBool:&value forKey:11]);
1830 XCTAssertTrue([dict getBool:NULL forKey:12]);
1831 XCTAssertTrue([dict getBool:&value forKey:12]);
1833 XCTAssertTrue([dict getBool:NULL forKey:13]);
1834 XCTAssertTrue([dict getBool:&value forKey:13]);
1836 XCTAssertTrue([dict getBool:NULL forKey:14]);
1837 XCTAssertTrue([dict getBool:&value forKey:14]);
1840 [dict setBool:YES forKey:14];
1841 XCTAssertEqual(dict.count, 4U);
1842 XCTAssertTrue([dict getBool:NULL forKey:11]);
1843 XCTAssertTrue([dict getBool:&value forKey:11]);
1845 XCTAssertTrue([dict getBool:NULL forKey:12]);
1846 XCTAssertTrue([dict getBool:&value forKey:12]);
1848 XCTAssertTrue([dict getBool:NULL forKey:13]);
1849 XCTAssertTrue([dict getBool:&value forKey:13]);
1851 XCTAssertTrue([dict getBool:NULL forKey:14]);
1852 XCTAssertTrue([dict getBool:&value forKey:14]);
1862 [dict addEntriesFromDictionary:dict2];
1863 XCTAssertEqual(dict.count, 4U);
1864 XCTAssertTrue([dict getBool:NULL forKey:11]);
1865 XCTAssertTrue([dict getBool:&value forKey:11]);
1867 XCTAssertTrue([dict getBool:NULL forKey:12]);
1868 XCTAssertTrue([dict getBool:&value forKey:12]);
1870 XCTAssertTrue([dict getBool:NULL forKey:13]);
1871 XCTAssertTrue([dict getBool:&value forKey:13]);
1873 XCTAssertTrue([dict getBool:NULL forKey:14]);
1874 XCTAssertTrue([dict getBool:&value forKey:14]);
1878 [dict release];
1891 GPBInt32FloatDictionary *dict = [[GPBInt32FloatDictionary alloc] init];
1892 XCTAssertNotNil(dict);
1893 XCTAssertEqual(dict.count, 0U);
1894 XCTAssertFalse([dict getFloat:NULL forKey:11]);
1895 [dict enumerateKeysAndFloatsUsingBlock:^(int32_t aKey, float aValue, BOOL *stop) {
1899 [dict release];
1903 GPBInt32FloatDictionary *dict = [[GPBInt32FloatDictionary alloc] init];
1904 [dict setFloat:500.f forKey:11];
1905 XCTAssertNotNil(dict);
1906 XCTAssertEqual(dict.count, 1U);
1908 XCTAssertTrue([dict getFloat:NULL forKey:11]);
1909 XCTAssertTrue([dict getFloat:&value forKey:11]);
1911 XCTAssertFalse([dict getFloat:NULL forKey:12]);
1912 [dict enumerateKeysAndFloatsUsingBlock:^(int32_t aKey, float aValue, BOOL *stop) {
1917 [dict release];
1923 GPBInt32FloatDictionary *dict =
1927 XCTAssertNotNil(dict);
1928 XCTAssertEqual(dict.count, 3U);
1930 XCTAssertTrue([dict getFloat:NULL forKey:11]);
1931 XCTAssertTrue([dict getFloat:&value forKey:11]);
1933 XCTAssertTrue([dict getFloat:NULL forKey:12]);
1934 XCTAssertTrue([dict getFloat:&value forKey:12]);
1936 XCTAssertTrue([dict getFloat:NULL forKey:13]);
1937 XCTAssertTrue([dict getFloat:&value forKey:13]);
1939 XCTAssertFalse([dict getFloat:NULL forKey:14]);
1944 [dict enumerateKeysAndFloatsUsingBlock:^(int32_t aKey, float aValue, BOOL *stop) {
1966 [dict enumerateKeysAndFloatsUsingBlock:^(int32_t aKey, float aValue, BOOL *stop) {
1972 [dict release];
2032 GPBInt32FloatDictionary *dict =
2036 XCTAssertNotNil(dict);
2038 GPBInt32FloatDictionary *dict2 = [dict copy];
2042 XCTAssertNotEqual(dict, dict2);
2043 XCTAssertEqualObjects(dict, dict2);
2047 [dict release];
2053 GPBInt32FloatDictionary *dict =
2057 XCTAssertNotNil(dict);
2060 [[GPBInt32FloatDictionary alloc] initWithDictionary:dict];
2064 XCTAssertNotEqual(dict, dict2);
2065 XCTAssertEqualObjects(dict, dict2);
2067 [dict release];
2071 GPBInt32FloatDictionary *dict = [[GPBInt32FloatDictionary alloc] init];
2072 XCTAssertNotNil(dict);
2074 XCTAssertEqual(dict.count, 0U);
2075 [dict setFloat:500.f forKey:11];
2076 XCTAssertEqual(dict.count, 1U);
2085 [dict addEntriesFromDictionary:dict2];
2086 XCTAssertEqual(dict.count, 4U);
2089 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2090 XCTAssertTrue([dict getFloat:&value forKey:11]);
2092 XCTAssertTrue([dict getFloat:NULL forKey:12]);
2093 XCTAssertTrue([dict getFloat:&value forKey:12]);
2095 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2096 XCTAssertTrue([dict getFloat:&value forKey:13]);
2098 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2099 XCTAssertTrue([dict getFloat:&value forKey:14]);
2102 [dict release];
2108 GPBInt32FloatDictionary *dict =
2112 XCTAssertNotNil(dict);
2113 XCTAssertEqual(dict.count, 4U);
2115 [dict removeFloatForKey:12];
2116 XCTAssertEqual(dict.count, 3U);
2118 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2119 XCTAssertTrue([dict getFloat:&value forKey:11]);
2121 XCTAssertFalse([dict getFloat:NULL forKey:12]);
2122 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2123 XCTAssertTrue([dict getFloat:&value forKey:13]);
2125 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2126 XCTAssertTrue([dict getFloat:&value forKey:14]);
2130 [dict removeFloatForKey:12];
2131 XCTAssertEqual(dict.count, 3U);
2132 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2133 XCTAssertTrue([dict getFloat:&value forKey:11]);
2135 XCTAssertFalse([dict getFloat:NULL forKey:12]);
2136 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2137 XCTAssertTrue([dict getFloat:&value forKey:13]);
2139 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2140 XCTAssertTrue([dict getFloat:&value forKey:14]);
2143 [dict removeFloatForKey:14];
2144 XCTAssertEqual(dict.count, 2U);
2145 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2146 XCTAssertTrue([dict getFloat:&value forKey:11]);
2148 XCTAssertFalse([dict getFloat:NULL forKey:12]);
2149 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2150 XCTAssertTrue([dict getFloat:&value forKey:13]);
2152 XCTAssertFalse([dict getFloat:NULL forKey:14]);
2154 [dict removeAll];
2155 XCTAssertEqual(dict.count, 0U);
2156 XCTAssertFalse([dict getFloat:NULL forKey:11]);
2157 XCTAssertFalse([dict getFloat:NULL forKey:12]);
2158 XCTAssertFalse([dict getFloat:NULL forKey:13]);
2159 XCTAssertFalse([dict getFloat:NULL forKey:14]);
2160 [dict release];
2166 GPBInt32FloatDictionary *dict =
2170 XCTAssertNotNil(dict);
2171 XCTAssertEqual(dict.count, 4U);
2173 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2174 XCTAssertTrue([dict getFloat:&value forKey:11]);
2176 XCTAssertTrue([dict getFloat:NULL forKey:12]);
2177 XCTAssertTrue([dict getFloat:&value forKey:12]);
2179 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2180 XCTAssertTrue([dict getFloat:&value forKey:13]);
2182 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2183 XCTAssertTrue([dict getFloat:&value forKey:14]);
2186 [dict setFloat:503.f forKey:11];
2187 XCTAssertEqual(dict.count, 4U);
2188 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2189 XCTAssertTrue([dict getFloat:&value forKey:11]);
2191 XCTAssertTrue([dict getFloat:NULL forKey:12]);
2192 XCTAssertTrue([dict getFloat:&value forKey:12]);
2194 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2195 XCTAssertTrue([dict getFloat:&value forKey:13]);
2197 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2198 XCTAssertTrue([dict getFloat:&value forKey:14]);
2201 [dict setFloat:501.f forKey:14];
2202 XCTAssertEqual(dict.count, 4U);
2203 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2204 XCTAssertTrue([dict getFloat:&value forKey:11]);
2206 XCTAssertTrue([dict getFloat:NULL forKey:12]);
2207 XCTAssertTrue([dict getFloat:&value forKey:12]);
2209 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2210 XCTAssertTrue([dict getFloat:&value forKey:13]);
2212 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2213 XCTAssertTrue([dict getFloat:&value forKey:14]);
2223 [dict addEntriesFromDictionary:dict2];
2224 XCTAssertEqual(dict.count, 4U);
2225 XCTAssertTrue([dict getFloat:NULL forKey:11]);
2226 XCTAssertTrue([dict getFloat:&value forKey:11]);
2228 XCTAssertTrue([dict getFloat:NULL forKey:12]);
2229 XCTAssertTrue([dict getFloat:&value forKey:12]);
2231 XCTAssertTrue([dict getFloat:NULL forKey:13]);
2232 XCTAssertTrue([dict getFloat:&value forKey:13]);
2234 XCTAssertTrue([dict getFloat:NULL forKey:14]);
2235 XCTAssertTrue([dict getFloat:&value forKey:14]);
2239 [dict release];
2252 GPBInt32DoubleDictionary *dict = [[GPBInt32DoubleDictionary alloc] init];
2253 XCTAssertNotNil(dict);
2254 XCTAssertEqual(dict.count, 0U);
2255 XCTAssertFalse([dict getDouble:NULL forKey:11]);
2256 [dict enumerateKeysAndDoublesUsingBlock:^(int32_t aKey, double aValue, BOOL *stop) {
2260 [dict release];
2264 GPBInt32DoubleDictionary *dict = [[GPBInt32DoubleDictionary alloc] init];
2265 [dict setDouble:600. forKey:11];
2266 XCTAssertNotNil(dict);
2267 XCTAssertEqual(dict.count, 1U);
2269 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2270 XCTAssertTrue([dict getDouble:&value forKey:11]);
2272 XCTAssertFalse([dict getDouble:NULL forKey:12]);
2273 [dict enumerateKeysAndDoublesUsingBlock:^(int32_t aKey, double aValue, BOOL *stop) {
2278 [dict release];
2284 GPBInt32DoubleDictionary *dict =
2288 XCTAssertNotNil(dict);
2289 XCTAssertEqual(dict.count, 3U);
2291 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2292 XCTAssertTrue([dict getDouble:&value forKey:11]);
2294 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2295 XCTAssertTrue([dict getDouble:&value forKey:12]);
2297 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2298 XCTAssertTrue([dict getDouble:&value forKey:13]);
2300 XCTAssertFalse([dict getDouble:NULL forKey:14]);
2305 [dict enumerateKeysAndDoublesUsingBlock:^(int32_t aKey, double aValue, BOOL *stop) {
2327 [dict enumerateKeysAndDoublesUsingBlock:^(int32_t aKey, double aValue, BOOL *stop) {
2333 [dict release];
2393 GPBInt32DoubleDictionary *dict =
2397 XCTAssertNotNil(dict);
2399 GPBInt32DoubleDictionary *dict2 = [dict copy];
2403 XCTAssertNotEqual(dict, dict2);
2404 XCTAssertEqualObjects(dict, dict2);
2408 [dict release];
2414 GPBInt32DoubleDictionary *dict =
2418 XCTAssertNotNil(dict);
2421 [[GPBInt32DoubleDictionary alloc] initWithDictionary:dict];
2425 XCTAssertNotEqual(dict, dict2);
2426 XCTAssertEqualObjects(dict, dict2);
2428 [dict release];
2432 GPBInt32DoubleDictionary *dict = [[GPBInt32DoubleDictionary alloc] init];
2433 XCTAssertNotNil(dict);
2435 XCTAssertEqual(dict.count, 0U);
2436 [dict setDouble:600. forKey:11];
2437 XCTAssertEqual(dict.count, 1U);
2446 [dict addEntriesFromDictionary:dict2];
2447 XCTAssertEqual(dict.count, 4U);
2450 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2451 XCTAssertTrue([dict getDouble:&value forKey:11]);
2453 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2454 XCTAssertTrue([dict getDouble:&value forKey:12]);
2456 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2457 XCTAssertTrue([dict getDouble:&value forKey:13]);
2459 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2460 XCTAssertTrue([dict getDouble:&value forKey:14]);
2463 [dict release];
2469 GPBInt32DoubleDictionary *dict =
2473 XCTAssertNotNil(dict);
2474 XCTAssertEqual(dict.count, 4U);
2476 [dict removeDoubleForKey:12];
2477 XCTAssertEqual(dict.count, 3U);
2479 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2480 XCTAssertTrue([dict getDouble:&value forKey:11]);
2482 XCTAssertFalse([dict getDouble:NULL forKey:12]);
2483 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2484 XCTAssertTrue([dict getDouble:&value forKey:13]);
2486 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2487 XCTAssertTrue([dict getDouble:&value forKey:14]);
2491 [dict removeDoubleForKey:12];
2492 XCTAssertEqual(dict.count, 3U);
2493 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2494 XCTAssertTrue([dict getDouble:&value forKey:11]);
2496 XCTAssertFalse([dict getDouble:NULL forKey:12]);
2497 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2498 XCTAssertTrue([dict getDouble:&value forKey:13]);
2500 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2501 XCTAssertTrue([dict getDouble:&value forKey:14]);
2504 [dict removeDoubleForKey:14];
2505 XCTAssertEqual(dict.count, 2U);
2506 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2507 XCTAssertTrue([dict getDouble:&value forKey:11]);
2509 XCTAssertFalse([dict getDouble:NULL forKey:12]);
2510 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2511 XCTAssertTrue([dict getDouble:&value forKey:13]);
2513 XCTAssertFalse([dict getDouble:NULL forKey:14]);
2515 [dict removeAll];
2516 XCTAssertEqual(dict.count, 0U);
2517 XCTAssertFalse([dict getDouble:NULL forKey:11]);
2518 XCTAssertFalse([dict getDouble:NULL forKey:12]);
2519 XCTAssertFalse([dict getDouble:NULL forKey:13]);
2520 XCTAssertFalse([dict getDouble:NULL forKey:14]);
2521 [dict release];
2527 GPBInt32DoubleDictionary *dict =
2531 XCTAssertNotNil(dict);
2532 XCTAssertEqual(dict.count, 4U);
2534 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2535 XCTAssertTrue([dict getDouble:&value forKey:11]);
2537 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2538 XCTAssertTrue([dict getDouble:&value forKey:12]);
2540 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2541 XCTAssertTrue([dict getDouble:&value forKey:13]);
2543 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2544 XCTAssertTrue([dict getDouble:&value forKey:14]);
2547 [dict setDouble:603. forKey:11];
2548 XCTAssertEqual(dict.count, 4U);
2549 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2550 XCTAssertTrue([dict getDouble:&value forKey:11]);
2552 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2553 XCTAssertTrue([dict getDouble:&value forKey:12]);
2555 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2556 XCTAssertTrue([dict getDouble:&value forKey:13]);
2558 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2559 XCTAssertTrue([dict getDouble:&value forKey:14]);
2562 [dict setDouble:601. forKey:14];
2563 XCTAssertEqual(dict.count, 4U);
2564 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2565 XCTAssertTrue([dict getDouble:&value forKey:11]);
2567 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2568 XCTAssertTrue([dict getDouble:&value forKey:12]);
2570 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2571 XCTAssertTrue([dict getDouble:&value forKey:13]);
2573 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2574 XCTAssertTrue([dict getDouble:&value forKey:14]);
2584 [dict addEntriesFromDictionary:dict2];
2585 XCTAssertEqual(dict.count, 4U);
2586 XCTAssertTrue([dict getDouble:NULL forKey:11]);
2587 XCTAssertTrue([dict getDouble:&value forKey:11]);
2589 XCTAssertTrue([dict getDouble:NULL forKey:12]);
2590 XCTAssertTrue([dict getDouble:&value forKey:12]);
2592 XCTAssertTrue([dict getDouble:NULL forKey:13]);
2593 XCTAssertTrue([dict getDouble:&value forKey:13]);
2595 XCTAssertTrue([dict getDouble:NULL forKey:14]);
2596 XCTAssertTrue([dict getDouble:&value forKey:14]);
2600 [dict release];
2613 GPBInt32EnumDictionary *dict = [[GPBInt32EnumDictionary alloc] init];
2614 XCTAssertNotNil(dict);
2615 XCTAssertEqual(dict.count, 0U);
2616 XCTAssertFalse([dict getEnum:NULL forKey:11]);
2617 [dict enumerateKeysAndEnumsUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
2621 [dict release];
2625 GPBInt32EnumDictionary *dict = [[GPBInt32EnumDictionary alloc] init];
2626 [dict setEnum:700 forKey:11];
2627 XCTAssertNotNil(dict);
2628 XCTAssertEqual(dict.count, 1U);
2630 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2631 XCTAssertTrue([dict getEnum:&value forKey:11]);
2633 XCTAssertFalse([dict getEnum:NULL forKey:12]);
2634 [dict enumerateKeysAndEnumsUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
2639 [dict release];
2645 GPBInt32EnumDictionary *dict =
2649 XCTAssertNotNil(dict);
2650 XCTAssertEqual(dict.count, 3U);
2652 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2653 XCTAssertTrue([dict getEnum:&value forKey:11]);
2655 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2656 XCTAssertTrue([dict getEnum:&value forKey:12]);
2658 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2659 XCTAssertTrue([dict getEnum:&value forKey:13]);
2661 XCTAssertFalse([dict getEnum:NULL forKey:14]);
2666 [dict enumerateKeysAndEnumsUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
2688 [dict enumerateKeysAndEnumsUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
2694 [dict release];
2754 GPBInt32EnumDictionary *dict =
2758 XCTAssertNotNil(dict);
2760 GPBInt32EnumDictionary *dict2 = [dict copy];
2764 XCTAssertNotEqual(dict, dict2);
2765 XCTAssertEqualObjects(dict, dict2);
2769 [dict release];
2775 GPBInt32EnumDictionary *dict =
2779 XCTAssertNotNil(dict);
2782 [[GPBInt32EnumDictionary alloc] initWithDictionary:dict];
2786 XCTAssertNotEqual(dict, dict2);
2787 XCTAssertEqualObjects(dict, dict2);
2789 [dict release];
2793 GPBInt32EnumDictionary *dict = [[GPBInt32EnumDictionary alloc] init];
2794 XCTAssertNotNil(dict);
2796 XCTAssertEqual(dict.count, 0U);
2797 [dict setEnum:700 forKey:11];
2798 XCTAssertEqual(dict.count, 1U);
2807 [dict addRawEntriesFromDictionary:dict2];
2808 XCTAssertEqual(dict.count, 4U);
2811 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2812 XCTAssertTrue([dict getEnum:&value forKey:11]);
2814 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2815 XCTAssertTrue([dict getEnum:&value forKey:12]);
2817 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2818 XCTAssertTrue([dict getEnum:&value forKey:13]);
2820 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2821 XCTAssertTrue([dict getEnum:&value forKey:14]);
2824 [dict release];
2830 GPBInt32EnumDictionary *dict =
2834 XCTAssertNotNil(dict);
2835 XCTAssertEqual(dict.count, 4U);
2837 [dict removeEnumForKey:12];
2838 XCTAssertEqual(dict.count, 3U);
2840 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2841 XCTAssertTrue([dict getEnum:&value forKey:11]);
2843 XCTAssertFalse([dict getEnum:NULL forKey:12]);
2844 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2845 XCTAssertTrue([dict getEnum:&value forKey:13]);
2847 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2848 XCTAssertTrue([dict getEnum:&value forKey:14]);
2852 [dict removeEnumForKey:12];
2853 XCTAssertEqual(dict.count, 3U);
2854 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2855 XCTAssertTrue([dict getEnum:&value forKey:11]);
2857 XCTAssertFalse([dict getEnum:NULL forKey:12]);
2858 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2859 XCTAssertTrue([dict getEnum:&value forKey:13]);
2861 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2862 XCTAssertTrue([dict getEnum:&value forKey:14]);
2865 [dict removeEnumForKey:14];
2866 XCTAssertEqual(dict.count, 2U);
2867 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2868 XCTAssertTrue([dict getEnum:&value forKey:11]);
2870 XCTAssertFalse([dict getEnum:NULL forKey:12]);
2871 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2872 XCTAssertTrue([dict getEnum:&value forKey:13]);
2874 XCTAssertFalse([dict getEnum:NULL forKey:14]);
2876 [dict removeAll];
2877 XCTAssertEqual(dict.count, 0U);
2878 XCTAssertFalse([dict getEnum:NULL forKey:11]);
2879 XCTAssertFalse([dict getEnum:NULL forKey:12]);
2880 XCTAssertFalse([dict getEnum:NULL forKey:13]);
2881 XCTAssertFalse([dict getEnum:NULL forKey:14]);
2882 [dict release];
2888 GPBInt32EnumDictionary *dict =
2892 XCTAssertNotNil(dict);
2893 XCTAssertEqual(dict.count, 4U);
2895 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2896 XCTAssertTrue([dict getEnum:&value forKey:11]);
2898 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2899 XCTAssertTrue([dict getEnum:&value forKey:12]);
2901 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2902 XCTAssertTrue([dict getEnum:&value forKey:13]);
2904 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2905 XCTAssertTrue([dict getEnum:&value forKey:14]);
2908 [dict setEnum:703 forKey:11];
2909 XCTAssertEqual(dict.count, 4U);
2910 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2911 XCTAssertTrue([dict getEnum:&value forKey:11]);
2913 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2914 XCTAssertTrue([dict getEnum:&value forKey:12]);
2916 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2917 XCTAssertTrue([dict getEnum:&value forKey:13]);
2919 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2920 XCTAssertTrue([dict getEnum:&value forKey:14]);
2923 [dict setEnum:701 forKey:14];
2924 XCTAssertEqual(dict.count, 4U);
2925 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2926 XCTAssertTrue([dict getEnum:&value forKey:11]);
2928 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2929 XCTAssertTrue([dict getEnum:&value forKey:12]);
2931 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2932 XCTAssertTrue([dict getEnum:&value forKey:13]);
2934 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2935 XCTAssertTrue([dict getEnum:&value forKey:14]);
2945 [dict addRawEntriesFromDictionary:dict2];
2946 XCTAssertEqual(dict.count, 4U);
2947 XCTAssertTrue([dict getEnum:NULL forKey:11]);
2948 XCTAssertTrue([dict getEnum:&value forKey:11]);
2950 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2951 XCTAssertTrue([dict getEnum:&value forKey:12]);
2953 XCTAssertTrue([dict getEnum:NULL forKey:13]);
2954 XCTAssertTrue([dict getEnum:&value forKey:13]);
2956 XCTAssertTrue([dict getEnum:NULL forKey:14]);
2957 XCTAssertTrue([dict getEnum:&value forKey:14]);
2961 [dict release];
2976 GPBInt32EnumDictionary *dict =
2981 XCTAssertNotNil(dict);
2982 XCTAssertEqual(dict.count, 3U);
2983 XCTAssertTrue(dict.validationFunc == TestingEnum_IsValidValue); // Pointer comparison
2985 XCTAssertTrue([dict getRawValue:NULL forKey:11]);
2986 XCTAssertTrue([dict getRawValue:&value forKey:11]);
2988 XCTAssertTrue([dict getEnum:NULL forKey:12]);
2989 XCTAssertTrue([dict getEnum:&value forKey:12]);
2991 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
2992 XCTAssertTrue([dict getRawValue:&value forKey:12]);
2994 XCTAssertTrue([dict getRawValue:NULL forKey:13]);
2995 XCTAssertTrue([dict getRawValue:&value forKey:13]);
2997 XCTAssertFalse([dict getRawValue:NULL forKey:14]);
3002 [dict enumerateKeysAndEnumsUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
3024 [dict enumerateKeysAndRawValuesUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
3046 [dict enumerateKeysAndRawValuesUsingBlock:^(int32_t aKey, int32_t aValue, BOOL *stop) {
3052 [dict release];
3117 GPBInt32EnumDictionary *dict =
3122 XCTAssertNotNil(dict);
3124 GPBInt32EnumDictionary *dict2 = [dict copy];
3128 XCTAssertNotEqual(dict, dict2);
3129 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3130 XCTAssertEqualObjects(dict, dict2);
3133 [dict release];
3139 GPBInt32EnumDictionary *dict =
3144 XCTAssertNotNil(dict);
3147 [[GPBInt32EnumDictionary alloc] initWithDictionary:dict];
3151 XCTAssertNotEqual(dict, dict2);
3152 XCTAssertEqualObjects(dict, dict2);
3153 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3155 [dict release];
3159 GPBInt32EnumDictionary *dict =
3161 XCTAssertNotNil(dict);
3163 XCTAssertEqual(dict.count, 0U);
3164 XCTAssertThrowsSpecificNamed([dict setEnum:801 forKey:12], // Unknown
3166 XCTAssertEqual(dict.count, 0U);
3167 [dict setRawValue:801 forKey:12]; // Unknown
3168 XCTAssertEqual(dict.count, 1U);
3177 [dict addRawEntriesFromDictionary:dict2];
3178 XCTAssertEqual(dict.count, 4U);
3181 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3182 XCTAssertTrue([dict getEnum:&value forKey:11]);
3184 XCTAssertTrue([dict getEnum:NULL forKey:12]);
3185 XCTAssertTrue([dict getEnum:&value forKey:12]);
3187 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
3188 XCTAssertTrue([dict getRawValue:&value forKey:12]);
3190 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3191 XCTAssertTrue([dict getEnum:&value forKey:13]);
3193 XCTAssertTrue([dict getEnum:NULL forKey:14]);
3194 XCTAssertTrue([dict getEnum:&value forKey:14]);
3196 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3197 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3200 [dict release];
3206 GPBInt32EnumDictionary *dict =
3211 XCTAssertNotNil(dict);
3212 XCTAssertEqual(dict.count, 4U);
3214 [dict removeEnumForKey:12];
3215 XCTAssertEqual(dict.count, 3U);
3217 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3218 XCTAssertTrue([dict getEnum:&value forKey:11]);
3220 XCTAssertFalse([dict getEnum:NULL forKey:12]);
3221 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3222 XCTAssertTrue([dict getEnum:&value forKey:13]);
3224 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3225 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3229 [dict removeEnumForKey:12];
3230 XCTAssertEqual(dict.count, 3U);
3231 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3232 XCTAssertTrue([dict getEnum:&value forKey:11]);
3234 XCTAssertFalse([dict getEnum:NULL forKey:12]);
3235 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3236 XCTAssertTrue([dict getEnum:&value forKey:13]);
3238 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3239 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3242 [dict removeEnumForKey:14];
3243 XCTAssertEqual(dict.count, 2U);
3244 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3245 XCTAssertTrue([dict getEnum:&value forKey:11]);
3247 XCTAssertFalse([dict getEnum:NULL forKey:12]);
3248 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3249 XCTAssertTrue([dict getEnum:&value forKey:13]);
3251 XCTAssertFalse([dict getEnum:NULL forKey:14]);
3253 [dict removeAll];
3254 XCTAssertEqual(dict.count, 0U);
3255 XCTAssertFalse([dict getEnum:NULL forKey:11]);
3256 XCTAssertFalse([dict getEnum:NULL forKey:12]);
3257 XCTAssertFalse([dict getEnum:NULL forKey:13]);
3258 XCTAssertFalse([dict getEnum:NULL forKey:14]);
3259 [dict release];
3265 GPBInt32EnumDictionary *dict =
3270 XCTAssertNotNil(dict);
3271 XCTAssertEqual(dict.count, 4U);
3273 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3274 XCTAssertTrue([dict getEnum:&value forKey:11]);
3276 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
3277 XCTAssertTrue([dict getRawValue:&value forKey:12]);
3279 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3280 XCTAssertTrue([dict getEnum:&value forKey:13]);
3282 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3283 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3286 XCTAssertThrowsSpecificNamed([dict setEnum:803 forKey:11], // Unknown
3288 XCTAssertEqual(dict.count, 4U);
3289 XCTAssertTrue([dict getEnum:NULL forKey:11]);
3290 XCTAssertTrue([dict getEnum:&value forKey:11]);
3292 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
3293 XCTAssertTrue([dict getRawValue:&value forKey:12]);
3295 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3296 XCTAssertTrue([dict getEnum:&value forKey:13]);
3298 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3299 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3302 [dict setRawValue:803 forKey:11]; // Unknown
3303 XCTAssertEqual(dict.count, 4U);
3304 XCTAssertTrue([dict getRawValue:NULL forKey:11]);
3305 XCTAssertTrue([dict getRawValue:&value forKey:11]);
3307 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
3308 XCTAssertTrue([dict getRawValue:&value forKey:12]);
3310 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3311 XCTAssertTrue([dict getEnum:&value forKey:13]);
3313 XCTAssertTrue([dict getRawValue:NULL forKey:14]);
3314 XCTAssertTrue([dict getRawValue:&value forKey:14]);
3317 [dict setRawValue:700 forKey:14];
3318 XCTAssertEqual(dict.count, 4U);
3319 XCTAssertTrue([dict getRawValue:NULL forKey:11]);
3320 XCTAssertTrue([dict getRawValue:&value forKey:11]);
3322 XCTAssertTrue([dict getRawValue:NULL forKey:12]);
3323 XCTAssertTrue([dict getRawValue:&value forKey:12]);
3325 XCTAssertTrue([dict getEnum:NULL forKey:13]);
3326 XCTAssertTrue([dict getEnum:&value forKey:13]);
3328 XCTAssertTrue([dict getEnum:NULL forKey:14]);
3329 XCTAssertTrue([dict getEnum:&value forKey:14]);
3340 [dict addRawEntriesFromDictionary:dict2];
3341 XCTAssertEqual(dict.count, 4U);
3342 XCTAssertTrue([dict getRawValue:NULL forKey:11]);
3343 XCTAssertTrue([dict getRawValue:&value forKey:11]);
3345 XCTAssertTrue([dict getEnum:NULL forKey:12]);
3346 XCTAssertTrue([dict getEnum:&value forKey:12]);
3348 XCTAssertTrue([dict getRawValue:NULL forKey:13]);
3349 XCTAssertTrue([dict getRawValue:&value forKey:13]);
3351 XCTAssertTrue([dict getEnum:NULL forKey:14]);
3352 XCTAssertTrue([dict getEnum:&value forKey:14]);
3356 [dict release];
3362 GPBInt32EnumDictionary *dict =
3367 XCTAssertNotNil(dict);
3369 GPBInt32EnumDictionary *dict2 = [dict copy];
3373 XCTAssertNotEqual(dict, dict2);
3374 XCTAssertEqualObjects(dict, dict2);
3375 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3379 [dict release];
3392 GPBInt32ObjectDictionary<NSString*> *dict = [[GPBInt32ObjectDictionary alloc] init];
3393 XCTAssertNotNil(dict);
3394 XCTAssertEqual(dict.count, 0U);
3395 XCTAssertNil([dict objectForKey:11]);
3396 [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, NSString* aObject, BOOL *stop) {
3400 [dict release];
3404 GPBInt32ObjectDictionary<NSString*> *dict = [[GPBInt32ObjectDictionary alloc] init];
3405 [dict setObject:@"abc" forKey:11];
3406 XCTAssertNotNil(dict);
3407 XCTAssertEqual(dict.count, 1U);
3408 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3409 XCTAssertNil([dict objectForKey:12]);
3410 [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, NSString* aObject, BOOL *stop) {
3415 [dict release];
3421 GPBInt32ObjectDictionary<NSString*> *dict =
3425 XCTAssertNotNil(dict);
3426 XCTAssertEqual(dict.count, 3U);
3427 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3428 XCTAssertEqualObjects([dict objectForKey:12], @"def");
3429 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3430 XCTAssertNil([dict objectForKey:14]);
3435 [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, NSString* aObject, BOOL *stop) {
3457 [dict enumerateKeysAndObjectsUsingBlock:^(int32_t aKey, NSString* aObject, BOOL *stop) {
3463 [dict release];
3523 GPBInt32ObjectDictionary<NSString*> *dict =
3527 XCTAssertNotNil(dict);
3529 GPBInt32ObjectDictionary<NSString*> *dict2 = [dict copy];
3533 XCTAssertNotEqual(dict, dict2);
3534 XCTAssertEqualObjects(dict, dict2);
3538 [dict release];
3544 GPBInt32ObjectDictionary<NSString*> *dict =
3548 XCTAssertNotNil(dict);
3551 [[GPBInt32ObjectDictionary alloc] initWithDictionary:dict];
3555 XCTAssertNotEqual(dict, dict2);
3556 XCTAssertEqualObjects(dict, dict2);
3558 [dict release];
3562 GPBInt32ObjectDictionary<NSString*> *dict = [[GPBInt32ObjectDictionary alloc] init];
3563 XCTAssertNotNil(dict);
3565 XCTAssertEqual(dict.count, 0U);
3566 [dict setObject:@"abc" forKey:11];
3567 XCTAssertEqual(dict.count, 1U);
3576 [dict addEntriesFromDictionary:dict2];
3577 XCTAssertEqual(dict.count, 4U);
3579 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3580 XCTAssertEqualObjects([dict objectForKey:12], @"def");
3581 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3582 XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
3584 [dict release];
3590 GPBInt32ObjectDictionary<NSString*> *dict =
3594 XCTAssertNotNil(dict);
3595 XCTAssertEqual(dict.count, 4U);
3597 [dict removeObjectForKey:12];
3598 XCTAssertEqual(dict.count, 3U);
3599 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3600 XCTAssertNil([dict objectForKey:12]);
3601 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3602 XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
3605 [dict removeObjectForKey:12];
3606 XCTAssertEqual(dict.count, 3U);
3607 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3608 XCTAssertNil([dict objectForKey:12]);
3609 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3610 XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
3612 [dict removeObjectForKey:14];
3613 XCTAssertEqual(dict.count, 2U);
3614 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3615 XCTAssertNil([dict objectForKey:12]);
3616 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3617 XCTAssertNil([dict objectForKey:14]);
3619 [dict removeAll];
3620 XCTAssertEqual(dict.count, 0U);
3621 XCTAssertNil([dict objectForKey:11]);
3622 XCTAssertNil([dict objectForKey:12]);
3623 XCTAssertNil([dict objectForKey:13]);
3624 XCTAssertNil([dict objectForKey:14]);
3625 [dict release];
3631 GPBInt32ObjectDictionary<NSString*> *dict =
3635 XCTAssertNotNil(dict);
3636 XCTAssertEqual(dict.count, 4U);
3637 XCTAssertEqualObjects([dict objectForKey:11], @"abc");
3638 XCTAssertEqualObjects([dict objectForKey:12], @"def");
3639 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3640 XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
3642 [dict setObject:@"jkl" forKey:11];
3643 XCTAssertEqual(dict.count, 4U);
3644 XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
3645 XCTAssertEqualObjects([dict objectForKey:12], @"def");
3646 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3647 XCTAssertEqualObjects([dict objectForKey:14], @"jkl");
3649 [dict setObject:@"def" forKey:14];
3650 XCTAssertEqual(dict.count, 4U);
3651 XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
3652 XCTAssertEqualObjects([dict objectForKey:12], @"def");
3653 XCTAssertEqualObjects([dict objectForKey:13], @"ghi");
3654 XCTAssertEqualObjects([dict objectForKey:14], @"def");
3663 [dict addEntriesFromDictionary:dict2];
3664 XCTAssertEqual(dict.count, 4U);
3665 XCTAssertEqualObjects([dict objectForKey:11], @"jkl");
3666 XCTAssertEqualObjects([dict objectForKey:12], @"ghi");
3667 XCTAssertEqualObjects([dict objectForKey:13], @"abc");
3668 XCTAssertEqualObjects([dict objectForKey:14], @"def");
3671 [dict release];