• Home
  • Raw
  • Download

Lines Matching refs:dict

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