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