Lines Matching full:dict

85   GPBStringUInt32Dictionary *dict = [[GPBStringUInt32Dictionary alloc] init];
86 XCTAssertNotNil(dict);
87 XCTAssertEqual(dict.count, 0U);
88 XCTAssertFalse([dict getUInt32:NULL forKey:@"foo"]);
89 [dict enumerateKeysAndUInt32sUsingBlock:^(NSString *aKey, uint32_t aValue, BOOL *stop) {
93 [dict release];
97 GPBStringUInt32Dictionary *dict = [[GPBStringUInt32Dictionary alloc] init];
98 [dict setUInt32:100U forKey:@"foo"];
99 XCTAssertNotNil(dict);
100 XCTAssertEqual(dict.count, 1U);
102 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
103 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
105 XCTAssertFalse([dict getUInt32:NULL forKey:@"bar"]);
106 [dict enumerateKeysAndUInt32sUsingBlock:^(NSString *aKey, uint32_t aValue, BOOL *stop) {
111 [dict release];
117 GPBStringUInt32Dictionary *dict =
121 XCTAssertNotNil(dict);
122 XCTAssertEqual(dict.count, 3U);
124 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
125 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
127 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
128 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
130 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
131 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
133 XCTAssertFalse([dict getUInt32:NULL forKey:@"mumble"]);
138 [dict enumerateKeysAndUInt32sUsingBlock:^(NSString *aKey, uint32_t aValue, BOOL *stop) {
160 [dict enumerateKeysAndUInt32sUsingBlock:^(NSString *aKey, uint32_t aValue, BOOL *stop) {
166 [dict release];
226 GPBStringUInt32Dictionary *dict =
230 XCTAssertNotNil(dict);
232 GPBStringUInt32Dictionary *dict2 = [dict copy];
236 XCTAssertNotEqual(dict, dict2);
237 XCTAssertEqualObjects(dict, dict2);
241 [dict release];
247 GPBStringUInt32Dictionary *dict =
251 XCTAssertNotNil(dict);
254 [[GPBStringUInt32Dictionary alloc] initWithDictionary:dict];
258 XCTAssertNotEqual(dict, dict2);
259 XCTAssertEqualObjects(dict, dict2);
261 [dict release];
265 GPBStringUInt32Dictionary *dict = [[GPBStringUInt32Dictionary alloc] init];
266 XCTAssertNotNil(dict);
268 XCTAssertEqual(dict.count, 0U);
269 [dict setUInt32:100U forKey:@"foo"];
270 XCTAssertEqual(dict.count, 1U);
279 [dict addEntriesFromDictionary:dict2];
280 XCTAssertEqual(dict.count, 4U);
283 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
284 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
286 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
287 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
289 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
290 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
292 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
293 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
296 [dict release];
302 GPBStringUInt32Dictionary *dict =
306 XCTAssertNotNil(dict);
307 XCTAssertEqual(dict.count, 4U);
309 [dict removeUInt32ForKey:@"bar"];
310 XCTAssertEqual(dict.count, 3U);
312 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
313 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
315 XCTAssertFalse([dict getUInt32:NULL forKey:@"bar"]);
316 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
317 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
319 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
320 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
324 [dict removeUInt32ForKey:@"bar"];
325 XCTAssertEqual(dict.count, 3U);
326 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
327 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
329 XCTAssertFalse([dict getUInt32:NULL forKey:@"bar"]);
330 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
331 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
333 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
334 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
337 [dict removeUInt32ForKey:@"mumble"];
338 XCTAssertEqual(dict.count, 2U);
339 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
340 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
342 XCTAssertFalse([dict getUInt32:NULL forKey:@"bar"]);
343 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
344 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
346 XCTAssertFalse([dict getUInt32:NULL forKey:@"mumble"]);
348 [dict removeAll];
349 XCTAssertEqual(dict.count, 0U);
350 XCTAssertFalse([dict getUInt32:NULL forKey:@"foo"]);
351 XCTAssertFalse([dict getUInt32:NULL forKey:@"bar"]);
352 XCTAssertFalse([dict getUInt32:NULL forKey:@"baz"]);
353 XCTAssertFalse([dict getUInt32:NULL forKey:@"mumble"]);
354 [dict release];
360 GPBStringUInt32Dictionary *dict =
364 XCTAssertNotNil(dict);
365 XCTAssertEqual(dict.count, 4U);
367 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
368 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
370 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
371 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
373 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
374 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
376 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
377 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
380 [dict setUInt32:103U forKey:@"foo"];
381 XCTAssertEqual(dict.count, 4U);
382 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
383 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
385 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
386 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
388 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
389 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
391 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
392 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
395 [dict setUInt32:101U forKey:@"mumble"];
396 XCTAssertEqual(dict.count, 4U);
397 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
398 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
400 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
401 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
403 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
404 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
406 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
407 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
417 [dict addEntriesFromDictionary:dict2];
418 XCTAssertEqual(dict.count, 4U);
419 XCTAssertTrue([dict getUInt32:NULL forKey:@"foo"]);
420 XCTAssertTrue([dict getUInt32:&value forKey:@"foo"]);
422 XCTAssertTrue([dict getUInt32:NULL forKey:@"bar"]);
423 XCTAssertTrue([dict getUInt32:&value forKey:@"bar"]);
425 XCTAssertTrue([dict getUInt32:NULL forKey:@"baz"]);
426 XCTAssertTrue([dict getUInt32:&value forKey:@"baz"]);
428 XCTAssertTrue([dict getUInt32:NULL forKey:@"mumble"]);
429 XCTAssertTrue([dict getUInt32:&value forKey:@"mumble"]);
433 [dict release];
446 GPBStringInt32Dictionary *dict = [[GPBStringInt32Dictionary alloc] init];
447 XCTAssertNotNil(dict);
448 XCTAssertEqual(dict.count, 0U);
449 XCTAssertFalse([dict getInt32:NULL forKey:@"foo"]);
450 [dict enumerateKeysAndInt32sUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
454 [dict release];
458 GPBStringInt32Dictionary *dict = [[GPBStringInt32Dictionary alloc] init];
459 [dict setInt32:200 forKey:@"foo"];
460 XCTAssertNotNil(dict);
461 XCTAssertEqual(dict.count, 1U);
463 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
464 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
466 XCTAssertFalse([dict getInt32:NULL forKey:@"bar"]);
467 [dict enumerateKeysAndInt32sUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
472 [dict release];
478 GPBStringInt32Dictionary *dict =
482 XCTAssertNotNil(dict);
483 XCTAssertEqual(dict.count, 3U);
485 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
486 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
488 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
489 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
491 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
492 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
494 XCTAssertFalse([dict getInt32:NULL forKey:@"mumble"]);
499 [dict enumerateKeysAndInt32sUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
521 [dict enumerateKeysAndInt32sUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
527 [dict release];
587 GPBStringInt32Dictionary *dict =
591 XCTAssertNotNil(dict);
593 GPBStringInt32Dictionary *dict2 = [dict copy];
597 XCTAssertNotEqual(dict, dict2);
598 XCTAssertEqualObjects(dict, dict2);
602 [dict release];
608 GPBStringInt32Dictionary *dict =
612 XCTAssertNotNil(dict);
615 [[GPBStringInt32Dictionary alloc] initWithDictionary:dict];
619 XCTAssertNotEqual(dict, dict2);
620 XCTAssertEqualObjects(dict, dict2);
622 [dict release];
626 GPBStringInt32Dictionary *dict = [[GPBStringInt32Dictionary alloc] init];
627 XCTAssertNotNil(dict);
629 XCTAssertEqual(dict.count, 0U);
630 [dict setInt32:200 forKey:@"foo"];
631 XCTAssertEqual(dict.count, 1U);
640 [dict addEntriesFromDictionary:dict2];
641 XCTAssertEqual(dict.count, 4U);
644 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
645 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
647 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
648 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
650 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
651 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
653 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
654 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
657 [dict release];
663 GPBStringInt32Dictionary *dict =
667 XCTAssertNotNil(dict);
668 XCTAssertEqual(dict.count, 4U);
670 [dict removeInt32ForKey:@"bar"];
671 XCTAssertEqual(dict.count, 3U);
673 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
674 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
676 XCTAssertFalse([dict getInt32:NULL forKey:@"bar"]);
677 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
678 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
680 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
681 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
685 [dict removeInt32ForKey:@"bar"];
686 XCTAssertEqual(dict.count, 3U);
687 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
688 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
690 XCTAssertFalse([dict getInt32:NULL forKey:@"bar"]);
691 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
692 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
694 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
695 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
698 [dict removeInt32ForKey:@"mumble"];
699 XCTAssertEqual(dict.count, 2U);
700 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
701 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
703 XCTAssertFalse([dict getInt32:NULL forKey:@"bar"]);
704 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
705 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
707 XCTAssertFalse([dict getInt32:NULL forKey:@"mumble"]);
709 [dict removeAll];
710 XCTAssertEqual(dict.count, 0U);
711 XCTAssertFalse([dict getInt32:NULL forKey:@"foo"]);
712 XCTAssertFalse([dict getInt32:NULL forKey:@"bar"]);
713 XCTAssertFalse([dict getInt32:NULL forKey:@"baz"]);
714 XCTAssertFalse([dict getInt32:NULL forKey:@"mumble"]);
715 [dict release];
721 GPBStringInt32Dictionary *dict =
725 XCTAssertNotNil(dict);
726 XCTAssertEqual(dict.count, 4U);
728 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
729 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
731 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
732 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
734 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
735 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
737 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
738 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
741 [dict setInt32:203 forKey:@"foo"];
742 XCTAssertEqual(dict.count, 4U);
743 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
744 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
746 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
747 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
749 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
750 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
752 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
753 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
756 [dict setInt32:201 forKey:@"mumble"];
757 XCTAssertEqual(dict.count, 4U);
758 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
759 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
761 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
762 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
764 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
765 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
767 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
768 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
778 [dict addEntriesFromDictionary:dict2];
779 XCTAssertEqual(dict.count, 4U);
780 XCTAssertTrue([dict getInt32:NULL forKey:@"foo"]);
781 XCTAssertTrue([dict getInt32:&value forKey:@"foo"]);
783 XCTAssertTrue([dict getInt32:NULL forKey:@"bar"]);
784 XCTAssertTrue([dict getInt32:&value forKey:@"bar"]);
786 XCTAssertTrue([dict getInt32:NULL forKey:@"baz"]);
787 XCTAssertTrue([dict getInt32:&value forKey:@"baz"]);
789 XCTAssertTrue([dict getInt32:NULL forKey:@"mumble"]);
790 XCTAssertTrue([dict getInt32:&value forKey:@"mumble"]);
794 [dict release];
807 GPBStringUInt64Dictionary *dict = [[GPBStringUInt64Dictionary alloc] init];
808 XCTAssertNotNil(dict);
809 XCTAssertEqual(dict.count, 0U);
810 XCTAssertFalse([dict getUInt64:NULL forKey:@"foo"]);
811 [dict enumerateKeysAndUInt64sUsingBlock:^(NSString *aKey, uint64_t aValue, BOOL *stop) {
815 [dict release];
819 GPBStringUInt64Dictionary *dict = [[GPBStringUInt64Dictionary alloc] init];
820 [dict setUInt64:300U forKey:@"foo"];
821 XCTAssertNotNil(dict);
822 XCTAssertEqual(dict.count, 1U);
824 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
825 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
827 XCTAssertFalse([dict getUInt64:NULL forKey:@"bar"]);
828 [dict enumerateKeysAndUInt64sUsingBlock:^(NSString *aKey, uint64_t aValue, BOOL *stop) {
833 [dict release];
839 GPBStringUInt64Dictionary *dict =
843 XCTAssertNotNil(dict);
844 XCTAssertEqual(dict.count, 3U);
846 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
847 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
849 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
850 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
852 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
853 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
855 XCTAssertFalse([dict getUInt64:NULL forKey:@"mumble"]);
860 [dict enumerateKeysAndUInt64sUsingBlock:^(NSString *aKey, uint64_t aValue, BOOL *stop) {
882 [dict enumerateKeysAndUInt64sUsingBlock:^(NSString *aKey, uint64_t aValue, BOOL *stop) {
888 [dict release];
948 GPBStringUInt64Dictionary *dict =
952 XCTAssertNotNil(dict);
954 GPBStringUInt64Dictionary *dict2 = [dict copy];
958 XCTAssertNotEqual(dict, dict2);
959 XCTAssertEqualObjects(dict, dict2);
963 [dict release];
969 GPBStringUInt64Dictionary *dict =
973 XCTAssertNotNil(dict);
976 [[GPBStringUInt64Dictionary alloc] initWithDictionary:dict];
980 XCTAssertNotEqual(dict, dict2);
981 XCTAssertEqualObjects(dict, dict2);
983 [dict release];
987 GPBStringUInt64Dictionary *dict = [[GPBStringUInt64Dictionary alloc] init];
988 XCTAssertNotNil(dict);
990 XCTAssertEqual(dict.count, 0U);
991 [dict setUInt64:300U forKey:@"foo"];
992 XCTAssertEqual(dict.count, 1U);
1001 [dict addEntriesFromDictionary:dict2];
1002 XCTAssertEqual(dict.count, 4U);
1005 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1006 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1008 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
1009 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
1011 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1012 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1014 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1015 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1018 [dict release];
1024 GPBStringUInt64Dictionary *dict =
1028 XCTAssertNotNil(dict);
1029 XCTAssertEqual(dict.count, 4U);
1031 [dict removeUInt64ForKey:@"bar"];
1032 XCTAssertEqual(dict.count, 3U);
1034 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1035 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1037 XCTAssertFalse([dict getUInt64:NULL forKey:@"bar"]);
1038 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1039 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1041 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1042 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1046 [dict removeUInt64ForKey:@"bar"];
1047 XCTAssertEqual(dict.count, 3U);
1048 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1049 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1051 XCTAssertFalse([dict getUInt64:NULL forKey:@"bar"]);
1052 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1053 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1055 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1056 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1059 [dict removeUInt64ForKey:@"mumble"];
1060 XCTAssertEqual(dict.count, 2U);
1061 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1062 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1064 XCTAssertFalse([dict getUInt64:NULL forKey:@"bar"]);
1065 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1066 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1068 XCTAssertFalse([dict getUInt64:NULL forKey:@"mumble"]);
1070 [dict removeAll];
1071 XCTAssertEqual(dict.count, 0U);
1072 XCTAssertFalse([dict getUInt64:NULL forKey:@"foo"]);
1073 XCTAssertFalse([dict getUInt64:NULL forKey:@"bar"]);
1074 XCTAssertFalse([dict getUInt64:NULL forKey:@"baz"]);
1075 XCTAssertFalse([dict getUInt64:NULL forKey:@"mumble"]);
1076 [dict release];
1082 GPBStringUInt64Dictionary *dict =
1086 XCTAssertNotNil(dict);
1087 XCTAssertEqual(dict.count, 4U);
1089 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1090 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1092 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
1093 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
1095 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1096 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1098 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1099 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1102 [dict setUInt64:303U forKey:@"foo"];
1103 XCTAssertEqual(dict.count, 4U);
1104 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1105 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1107 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
1108 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
1110 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1111 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1113 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1114 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1117 [dict setUInt64:301U forKey:@"mumble"];
1118 XCTAssertEqual(dict.count, 4U);
1119 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1120 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1122 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
1123 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
1125 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1126 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1128 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1129 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1139 [dict addEntriesFromDictionary:dict2];
1140 XCTAssertEqual(dict.count, 4U);
1141 XCTAssertTrue([dict getUInt64:NULL forKey:@"foo"]);
1142 XCTAssertTrue([dict getUInt64:&value forKey:@"foo"]);
1144 XCTAssertTrue([dict getUInt64:NULL forKey:@"bar"]);
1145 XCTAssertTrue([dict getUInt64:&value forKey:@"bar"]);
1147 XCTAssertTrue([dict getUInt64:NULL forKey:@"baz"]);
1148 XCTAssertTrue([dict getUInt64:&value forKey:@"baz"]);
1150 XCTAssertTrue([dict getUInt64:NULL forKey:@"mumble"]);
1151 XCTAssertTrue([dict getUInt64:&value forKey:@"mumble"]);
1155 [dict release];
1168 GPBStringInt64Dictionary *dict = [[GPBStringInt64Dictionary alloc] init];
1169 XCTAssertNotNil(dict);
1170 XCTAssertEqual(dict.count, 0U);
1171 XCTAssertFalse([dict getInt64:NULL forKey:@"foo"]);
1172 [dict enumerateKeysAndInt64sUsingBlock:^(NSString *aKey, int64_t aValue, BOOL *stop) {
1176 [dict release];
1180 GPBStringInt64Dictionary *dict = [[GPBStringInt64Dictionary alloc] init];
1181 [dict setInt64:400 forKey:@"foo"];
1182 XCTAssertNotNil(dict);
1183 XCTAssertEqual(dict.count, 1U);
1185 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1186 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1188 XCTAssertFalse([dict getInt64:NULL forKey:@"bar"]);
1189 [dict enumerateKeysAndInt64sUsingBlock:^(NSString *aKey, int64_t aValue, BOOL *stop) {
1194 [dict release];
1200 GPBStringInt64Dictionary *dict =
1204 XCTAssertNotNil(dict);
1205 XCTAssertEqual(dict.count, 3U);
1207 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1208 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1210 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1211 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1213 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1214 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1216 XCTAssertFalse([dict getInt64:NULL forKey:@"mumble"]);
1221 [dict enumerateKeysAndInt64sUsingBlock:^(NSString *aKey, int64_t aValue, BOOL *stop) {
1243 [dict enumerateKeysAndInt64sUsingBlock:^(NSString *aKey, int64_t aValue, BOOL *stop) {
1249 [dict release];
1309 GPBStringInt64Dictionary *dict =
1313 XCTAssertNotNil(dict);
1315 GPBStringInt64Dictionary *dict2 = [dict copy];
1319 XCTAssertNotEqual(dict, dict2);
1320 XCTAssertEqualObjects(dict, dict2);
1324 [dict release];
1330 GPBStringInt64Dictionary *dict =
1334 XCTAssertNotNil(dict);
1337 [[GPBStringInt64Dictionary alloc] initWithDictionary:dict];
1341 XCTAssertNotEqual(dict, dict2);
1342 XCTAssertEqualObjects(dict, dict2);
1344 [dict release];
1348 GPBStringInt64Dictionary *dict = [[GPBStringInt64Dictionary alloc] init];
1349 XCTAssertNotNil(dict);
1351 XCTAssertEqual(dict.count, 0U);
1352 [dict setInt64:400 forKey:@"foo"];
1353 XCTAssertEqual(dict.count, 1U);
1362 [dict addEntriesFromDictionary:dict2];
1363 XCTAssertEqual(dict.count, 4U);
1366 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1367 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1369 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1370 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1372 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1373 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1375 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1376 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1379 [dict release];
1385 GPBStringInt64Dictionary *dict =
1389 XCTAssertNotNil(dict);
1390 XCTAssertEqual(dict.count, 4U);
1392 [dict removeInt64ForKey:@"bar"];
1393 XCTAssertEqual(dict.count, 3U);
1395 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1396 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1398 XCTAssertFalse([dict getInt64:NULL forKey:@"bar"]);
1399 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1400 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1402 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1403 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1407 [dict removeInt64ForKey:@"bar"];
1408 XCTAssertEqual(dict.count, 3U);
1409 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1410 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1412 XCTAssertFalse([dict getInt64:NULL forKey:@"bar"]);
1413 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1414 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1416 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1417 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1420 [dict removeInt64ForKey:@"mumble"];
1421 XCTAssertEqual(dict.count, 2U);
1422 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1423 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1425 XCTAssertFalse([dict getInt64:NULL forKey:@"bar"]);
1426 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1427 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1429 XCTAssertFalse([dict getInt64:NULL forKey:@"mumble"]);
1431 [dict removeAll];
1432 XCTAssertEqual(dict.count, 0U);
1433 XCTAssertFalse([dict getInt64:NULL forKey:@"foo"]);
1434 XCTAssertFalse([dict getInt64:NULL forKey:@"bar"]);
1435 XCTAssertFalse([dict getInt64:NULL forKey:@"baz"]);
1436 XCTAssertFalse([dict getInt64:NULL forKey:@"mumble"]);
1437 [dict release];
1443 GPBStringInt64Dictionary *dict =
1447 XCTAssertNotNil(dict);
1448 XCTAssertEqual(dict.count, 4U);
1450 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1451 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1453 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1454 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1456 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1457 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1459 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1460 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1463 [dict setInt64:403 forKey:@"foo"];
1464 XCTAssertEqual(dict.count, 4U);
1465 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1466 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1468 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1469 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1471 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1472 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1474 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1475 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1478 [dict setInt64:401 forKey:@"mumble"];
1479 XCTAssertEqual(dict.count, 4U);
1480 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1481 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1483 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1484 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1486 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1487 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1489 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1490 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1500 [dict addEntriesFromDictionary:dict2];
1501 XCTAssertEqual(dict.count, 4U);
1502 XCTAssertTrue([dict getInt64:NULL forKey:@"foo"]);
1503 XCTAssertTrue([dict getInt64:&value forKey:@"foo"]);
1505 XCTAssertTrue([dict getInt64:NULL forKey:@"bar"]);
1506 XCTAssertTrue([dict getInt64:&value forKey:@"bar"]);
1508 XCTAssertTrue([dict getInt64:NULL forKey:@"baz"]);
1509 XCTAssertTrue([dict getInt64:&value forKey:@"baz"]);
1511 XCTAssertTrue([dict getInt64:NULL forKey:@"mumble"]);
1512 XCTAssertTrue([dict getInt64:&value forKey:@"mumble"]);
1516 [dict release];
1529 GPBStringBoolDictionary *dict = [[GPBStringBoolDictionary alloc] init];
1530 XCTAssertNotNil(dict);
1531 XCTAssertEqual(dict.count, 0U);
1532 XCTAssertFalse([dict getBool:NULL forKey:@"foo"]);
1533 [dict enumerateKeysAndBoolsUsingBlock:^(NSString *aKey, BOOL aValue, BOOL *stop) {
1537 [dict release];
1541 GPBStringBoolDictionary *dict = [[GPBStringBoolDictionary alloc] init];
1542 [dict setBool:YES forKey:@"foo"];
1543 XCTAssertNotNil(dict);
1544 XCTAssertEqual(dict.count, 1U);
1546 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1547 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1549 XCTAssertFalse([dict getBool:NULL forKey:@"bar"]);
1550 [dict enumerateKeysAndBoolsUsingBlock:^(NSString *aKey, BOOL aValue, BOOL *stop) {
1555 [dict release];
1561 GPBStringBoolDictionary *dict =
1565 XCTAssertNotNil(dict);
1566 XCTAssertEqual(dict.count, 3U);
1568 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1569 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1571 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1572 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1574 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1575 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1577 XCTAssertFalse([dict getBool:NULL forKey:@"mumble"]);
1582 [dict enumerateKeysAndBoolsUsingBlock:^(NSString *aKey, BOOL aValue, BOOL *stop) {
1604 [dict enumerateKeysAndBoolsUsingBlock:^(NSString *aKey, BOOL aValue, BOOL *stop) {
1610 [dict release];
1670 GPBStringBoolDictionary *dict =
1674 XCTAssertNotNil(dict);
1676 GPBStringBoolDictionary *dict2 = [dict copy];
1680 XCTAssertNotEqual(dict, dict2);
1681 XCTAssertEqualObjects(dict, dict2);
1685 [dict release];
1691 GPBStringBoolDictionary *dict =
1695 XCTAssertNotNil(dict);
1698 [[GPBStringBoolDictionary alloc] initWithDictionary:dict];
1702 XCTAssertNotEqual(dict, dict2);
1703 XCTAssertEqualObjects(dict, dict2);
1705 [dict release];
1709 GPBStringBoolDictionary *dict = [[GPBStringBoolDictionary alloc] init];
1710 XCTAssertNotNil(dict);
1712 XCTAssertEqual(dict.count, 0U);
1713 [dict setBool:YES forKey:@"foo"];
1714 XCTAssertEqual(dict.count, 1U);
1723 [dict addEntriesFromDictionary:dict2];
1724 XCTAssertEqual(dict.count, 4U);
1727 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1728 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1730 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1731 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1733 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1734 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1736 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1737 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1740 [dict release];
1746 GPBStringBoolDictionary *dict =
1750 XCTAssertNotNil(dict);
1751 XCTAssertEqual(dict.count, 4U);
1753 [dict removeBoolForKey:@"bar"];
1754 XCTAssertEqual(dict.count, 3U);
1756 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1757 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1759 XCTAssertFalse([dict getBool:NULL forKey:@"bar"]);
1760 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1761 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1763 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1764 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1768 [dict removeBoolForKey:@"bar"];
1769 XCTAssertEqual(dict.count, 3U);
1770 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1771 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1773 XCTAssertFalse([dict getBool:NULL forKey:@"bar"]);
1774 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1775 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1777 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1778 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1781 [dict removeBoolForKey:@"mumble"];
1782 XCTAssertEqual(dict.count, 2U);
1783 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1784 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1786 XCTAssertFalse([dict getBool:NULL forKey:@"bar"]);
1787 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1788 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1790 XCTAssertFalse([dict getBool:NULL forKey:@"mumble"]);
1792 [dict removeAll];
1793 XCTAssertEqual(dict.count, 0U);
1794 XCTAssertFalse([dict getBool:NULL forKey:@"foo"]);
1795 XCTAssertFalse([dict getBool:NULL forKey:@"bar"]);
1796 XCTAssertFalse([dict getBool:NULL forKey:@"baz"]);
1797 XCTAssertFalse([dict getBool:NULL forKey:@"mumble"]);
1798 [dict release];
1804 GPBStringBoolDictionary *dict =
1808 XCTAssertNotNil(dict);
1809 XCTAssertEqual(dict.count, 4U);
1811 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1812 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1814 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1815 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1817 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1818 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1820 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1821 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1824 [dict setBool:NO forKey:@"foo"];
1825 XCTAssertEqual(dict.count, 4U);
1826 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1827 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1829 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1830 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1832 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1833 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1835 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1836 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1839 [dict setBool:YES forKey:@"mumble"];
1840 XCTAssertEqual(dict.count, 4U);
1841 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1842 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1844 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1845 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1847 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1848 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1850 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1851 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1861 [dict addEntriesFromDictionary:dict2];
1862 XCTAssertEqual(dict.count, 4U);
1863 XCTAssertTrue([dict getBool:NULL forKey:@"foo"]);
1864 XCTAssertTrue([dict getBool:&value forKey:@"foo"]);
1866 XCTAssertTrue([dict getBool:NULL forKey:@"bar"]);
1867 XCTAssertTrue([dict getBool:&value forKey:@"bar"]);
1869 XCTAssertTrue([dict getBool:NULL forKey:@"baz"]);
1870 XCTAssertTrue([dict getBool:&value forKey:@"baz"]);
1872 XCTAssertTrue([dict getBool:NULL forKey:@"mumble"]);
1873 XCTAssertTrue([dict getBool:&value forKey:@"mumble"]);
1877 [dict release];
1890 GPBStringFloatDictionary *dict = [[GPBStringFloatDictionary alloc] init];
1891 XCTAssertNotNil(dict);
1892 XCTAssertEqual(dict.count, 0U);
1893 XCTAssertFalse([dict getFloat:NULL forKey:@"foo"]);
1894 [dict enumerateKeysAndFloatsUsingBlock:^(NSString *aKey, float aValue, BOOL *stop) {
1898 [dict release];
1902 GPBStringFloatDictionary *dict = [[GPBStringFloatDictionary alloc] init];
1903 [dict setFloat:500.f forKey:@"foo"];
1904 XCTAssertNotNil(dict);
1905 XCTAssertEqual(dict.count, 1U);
1907 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
1908 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
1910 XCTAssertFalse([dict getFloat:NULL forKey:@"bar"]);
1911 [dict enumerateKeysAndFloatsUsingBlock:^(NSString *aKey, float aValue, BOOL *stop) {
1916 [dict release];
1922 GPBStringFloatDictionary *dict =
1926 XCTAssertNotNil(dict);
1927 XCTAssertEqual(dict.count, 3U);
1929 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
1930 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
1932 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
1933 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
1935 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
1936 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
1938 XCTAssertFalse([dict getFloat:NULL forKey:@"mumble"]);
1943 [dict enumerateKeysAndFloatsUsingBlock:^(NSString *aKey, float aValue, BOOL *stop) {
1965 [dict enumerateKeysAndFloatsUsingBlock:^(NSString *aKey, float aValue, BOOL *stop) {
1971 [dict release];
2031 GPBStringFloatDictionary *dict =
2035 XCTAssertNotNil(dict);
2037 GPBStringFloatDictionary *dict2 = [dict copy];
2041 XCTAssertNotEqual(dict, dict2);
2042 XCTAssertEqualObjects(dict, dict2);
2046 [dict release];
2052 GPBStringFloatDictionary *dict =
2056 XCTAssertNotNil(dict);
2059 [[GPBStringFloatDictionary alloc] initWithDictionary:dict];
2063 XCTAssertNotEqual(dict, dict2);
2064 XCTAssertEqualObjects(dict, dict2);
2066 [dict release];
2070 GPBStringFloatDictionary *dict = [[GPBStringFloatDictionary alloc] init];
2071 XCTAssertNotNil(dict);
2073 XCTAssertEqual(dict.count, 0U);
2074 [dict setFloat:500.f forKey:@"foo"];
2075 XCTAssertEqual(dict.count, 1U);
2084 [dict addEntriesFromDictionary:dict2];
2085 XCTAssertEqual(dict.count, 4U);
2088 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2089 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2091 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
2092 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
2094 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2095 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2097 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2098 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2101 [dict release];
2107 GPBStringFloatDictionary *dict =
2111 XCTAssertNotNil(dict);
2112 XCTAssertEqual(dict.count, 4U);
2114 [dict removeFloatForKey:@"bar"];
2115 XCTAssertEqual(dict.count, 3U);
2117 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2118 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2120 XCTAssertFalse([dict getFloat:NULL forKey:@"bar"]);
2121 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2122 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2124 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2125 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2129 [dict removeFloatForKey:@"bar"];
2130 XCTAssertEqual(dict.count, 3U);
2131 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2132 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2134 XCTAssertFalse([dict getFloat:NULL forKey:@"bar"]);
2135 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2136 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2138 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2139 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2142 [dict removeFloatForKey:@"mumble"];
2143 XCTAssertEqual(dict.count, 2U);
2144 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2145 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2147 XCTAssertFalse([dict getFloat:NULL forKey:@"bar"]);
2148 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2149 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2151 XCTAssertFalse([dict getFloat:NULL forKey:@"mumble"]);
2153 [dict removeAll];
2154 XCTAssertEqual(dict.count, 0U);
2155 XCTAssertFalse([dict getFloat:NULL forKey:@"foo"]);
2156 XCTAssertFalse([dict getFloat:NULL forKey:@"bar"]);
2157 XCTAssertFalse([dict getFloat:NULL forKey:@"baz"]);
2158 XCTAssertFalse([dict getFloat:NULL forKey:@"mumble"]);
2159 [dict release];
2165 GPBStringFloatDictionary *dict =
2169 XCTAssertNotNil(dict);
2170 XCTAssertEqual(dict.count, 4U);
2172 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2173 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2175 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
2176 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
2178 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2179 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2181 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2182 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2185 [dict setFloat:503.f forKey:@"foo"];
2186 XCTAssertEqual(dict.count, 4U);
2187 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2188 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2190 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
2191 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
2193 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2194 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2196 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2197 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2200 [dict setFloat:501.f forKey:@"mumble"];
2201 XCTAssertEqual(dict.count, 4U);
2202 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2203 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2205 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
2206 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
2208 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2209 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2211 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2212 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2222 [dict addEntriesFromDictionary:dict2];
2223 XCTAssertEqual(dict.count, 4U);
2224 XCTAssertTrue([dict getFloat:NULL forKey:@"foo"]);
2225 XCTAssertTrue([dict getFloat:&value forKey:@"foo"]);
2227 XCTAssertTrue([dict getFloat:NULL forKey:@"bar"]);
2228 XCTAssertTrue([dict getFloat:&value forKey:@"bar"]);
2230 XCTAssertTrue([dict getFloat:NULL forKey:@"baz"]);
2231 XCTAssertTrue([dict getFloat:&value forKey:@"baz"]);
2233 XCTAssertTrue([dict getFloat:NULL forKey:@"mumble"]);
2234 XCTAssertTrue([dict getFloat:&value forKey:@"mumble"]);
2238 [dict release];
2251 GPBStringDoubleDictionary *dict = [[GPBStringDoubleDictionary alloc] init];
2252 XCTAssertNotNil(dict);
2253 XCTAssertEqual(dict.count, 0U);
2254 XCTAssertFalse([dict getDouble:NULL forKey:@"foo"]);
2255 [dict enumerateKeysAndDoublesUsingBlock:^(NSString *aKey, double aValue, BOOL *stop) {
2259 [dict release];
2263 GPBStringDoubleDictionary *dict = [[GPBStringDoubleDictionary alloc] init];
2264 [dict setDouble:600. forKey:@"foo"];
2265 XCTAssertNotNil(dict);
2266 XCTAssertEqual(dict.count, 1U);
2268 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2269 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2271 XCTAssertFalse([dict getDouble:NULL forKey:@"bar"]);
2272 [dict enumerateKeysAndDoublesUsingBlock:^(NSString *aKey, double aValue, BOOL *stop) {
2277 [dict release];
2283 GPBStringDoubleDictionary *dict =
2287 XCTAssertNotNil(dict);
2288 XCTAssertEqual(dict.count, 3U);
2290 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2291 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2293 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2294 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2296 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2297 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2299 XCTAssertFalse([dict getDouble:NULL forKey:@"mumble"]);
2304 [dict enumerateKeysAndDoublesUsingBlock:^(NSString *aKey, double aValue, BOOL *stop) {
2326 [dict enumerateKeysAndDoublesUsingBlock:^(NSString *aKey, double aValue, BOOL *stop) {
2332 [dict release];
2392 GPBStringDoubleDictionary *dict =
2396 XCTAssertNotNil(dict);
2398 GPBStringDoubleDictionary *dict2 = [dict copy];
2402 XCTAssertNotEqual(dict, dict2);
2403 XCTAssertEqualObjects(dict, dict2);
2407 [dict release];
2413 GPBStringDoubleDictionary *dict =
2417 XCTAssertNotNil(dict);
2420 [[GPBStringDoubleDictionary alloc] initWithDictionary:dict];
2424 XCTAssertNotEqual(dict, dict2);
2425 XCTAssertEqualObjects(dict, dict2);
2427 [dict release];
2431 GPBStringDoubleDictionary *dict = [[GPBStringDoubleDictionary alloc] init];
2432 XCTAssertNotNil(dict);
2434 XCTAssertEqual(dict.count, 0U);
2435 [dict setDouble:600. forKey:@"foo"];
2436 XCTAssertEqual(dict.count, 1U);
2445 [dict addEntriesFromDictionary:dict2];
2446 XCTAssertEqual(dict.count, 4U);
2449 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2450 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2452 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2453 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2455 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2456 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2458 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2459 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2462 [dict release];
2468 GPBStringDoubleDictionary *dict =
2472 XCTAssertNotNil(dict);
2473 XCTAssertEqual(dict.count, 4U);
2475 [dict removeDoubleForKey:@"bar"];
2476 XCTAssertEqual(dict.count, 3U);
2478 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2479 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2481 XCTAssertFalse([dict getDouble:NULL forKey:@"bar"]);
2482 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2483 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2485 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2486 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2490 [dict removeDoubleForKey:@"bar"];
2491 XCTAssertEqual(dict.count, 3U);
2492 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2493 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2495 XCTAssertFalse([dict getDouble:NULL forKey:@"bar"]);
2496 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2497 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2499 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2500 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2503 [dict removeDoubleForKey:@"mumble"];
2504 XCTAssertEqual(dict.count, 2U);
2505 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2506 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2508 XCTAssertFalse([dict getDouble:NULL forKey:@"bar"]);
2509 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2510 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2512 XCTAssertFalse([dict getDouble:NULL forKey:@"mumble"]);
2514 [dict removeAll];
2515 XCTAssertEqual(dict.count, 0U);
2516 XCTAssertFalse([dict getDouble:NULL forKey:@"foo"]);
2517 XCTAssertFalse([dict getDouble:NULL forKey:@"bar"]);
2518 XCTAssertFalse([dict getDouble:NULL forKey:@"baz"]);
2519 XCTAssertFalse([dict getDouble:NULL forKey:@"mumble"]);
2520 [dict release];
2526 GPBStringDoubleDictionary *dict =
2530 XCTAssertNotNil(dict);
2531 XCTAssertEqual(dict.count, 4U);
2533 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2534 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2536 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2537 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2539 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2540 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2542 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2543 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2546 [dict setDouble:603. forKey:@"foo"];
2547 XCTAssertEqual(dict.count, 4U);
2548 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2549 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2551 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2552 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2554 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2555 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2557 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2558 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2561 [dict setDouble:601. forKey:@"mumble"];
2562 XCTAssertEqual(dict.count, 4U);
2563 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2564 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2566 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2567 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2569 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2570 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2572 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2573 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2583 [dict addEntriesFromDictionary:dict2];
2584 XCTAssertEqual(dict.count, 4U);
2585 XCTAssertTrue([dict getDouble:NULL forKey:@"foo"]);
2586 XCTAssertTrue([dict getDouble:&value forKey:@"foo"]);
2588 XCTAssertTrue([dict getDouble:NULL forKey:@"bar"]);
2589 XCTAssertTrue([dict getDouble:&value forKey:@"bar"]);
2591 XCTAssertTrue([dict getDouble:NULL forKey:@"baz"]);
2592 XCTAssertTrue([dict getDouble:&value forKey:@"baz"]);
2594 XCTAssertTrue([dict getDouble:NULL forKey:@"mumble"]);
2595 XCTAssertTrue([dict getDouble:&value forKey:@"mumble"]);
2599 [dict release];
2612 GPBStringEnumDictionary *dict = [[GPBStringEnumDictionary alloc] init];
2613 XCTAssertNotNil(dict);
2614 XCTAssertEqual(dict.count, 0U);
2615 XCTAssertFalse([dict getEnum:NULL forKey:@"foo"]);
2616 [dict enumerateKeysAndEnumsUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
2620 [dict release];
2624 GPBStringEnumDictionary *dict = [[GPBStringEnumDictionary alloc] init];
2625 [dict setEnum:700 forKey:@"foo"];
2626 XCTAssertNotNil(dict);
2627 XCTAssertEqual(dict.count, 1U);
2629 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2630 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2632 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
2633 [dict enumerateKeysAndEnumsUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
2638 [dict release];
2644 GPBStringEnumDictionary *dict =
2648 XCTAssertNotNil(dict);
2649 XCTAssertEqual(dict.count, 3U);
2651 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2652 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2654 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2655 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2657 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2658 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2660 XCTAssertFalse([dict getEnum:NULL forKey:@"mumble"]);
2665 [dict enumerateKeysAndEnumsUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
2687 [dict enumerateKeysAndEnumsUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
2693 [dict release];
2753 GPBStringEnumDictionary *dict =
2757 XCTAssertNotNil(dict);
2759 GPBStringEnumDictionary *dict2 = [dict copy];
2763 XCTAssertNotEqual(dict, dict2);
2764 XCTAssertEqualObjects(dict, dict2);
2768 [dict release];
2774 GPBStringEnumDictionary *dict =
2778 XCTAssertNotNil(dict);
2781 [[GPBStringEnumDictionary alloc] initWithDictionary:dict];
2785 XCTAssertNotEqual(dict, dict2);
2786 XCTAssertEqualObjects(dict, dict2);
2788 [dict release];
2792 GPBStringEnumDictionary *dict = [[GPBStringEnumDictionary alloc] init];
2793 XCTAssertNotNil(dict);
2795 XCTAssertEqual(dict.count, 0U);
2796 [dict setEnum:700 forKey:@"foo"];
2797 XCTAssertEqual(dict.count, 1U);
2806 [dict addRawEntriesFromDictionary:dict2];
2807 XCTAssertEqual(dict.count, 4U);
2810 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2811 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2813 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2814 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2816 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2817 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2819 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2820 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2823 [dict release];
2829 GPBStringEnumDictionary *dict =
2833 XCTAssertNotNil(dict);
2834 XCTAssertEqual(dict.count, 4U);
2836 [dict removeEnumForKey:@"bar"];
2837 XCTAssertEqual(dict.count, 3U);
2839 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2840 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2842 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
2843 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2844 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2846 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2847 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2851 [dict removeEnumForKey:@"bar"];
2852 XCTAssertEqual(dict.count, 3U);
2853 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2854 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2856 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
2857 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2858 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2860 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2861 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2864 [dict removeEnumForKey:@"mumble"];
2865 XCTAssertEqual(dict.count, 2U);
2866 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2867 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2869 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
2870 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2871 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2873 XCTAssertFalse([dict getEnum:NULL forKey:@"mumble"]);
2875 [dict removeAll];
2876 XCTAssertEqual(dict.count, 0U);
2877 XCTAssertFalse([dict getEnum:NULL forKey:@"foo"]);
2878 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
2879 XCTAssertFalse([dict getEnum:NULL forKey:@"baz"]);
2880 XCTAssertFalse([dict getEnum:NULL forKey:@"mumble"]);
2881 [dict release];
2887 GPBStringEnumDictionary *dict =
2891 XCTAssertNotNil(dict);
2892 XCTAssertEqual(dict.count, 4U);
2894 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2895 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2897 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2898 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2900 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2901 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2903 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2904 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2907 [dict setEnum:703 forKey:@"foo"];
2908 XCTAssertEqual(dict.count, 4U);
2909 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2910 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2912 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2913 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2915 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2916 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2918 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2919 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2922 [dict setEnum:701 forKey:@"mumble"];
2923 XCTAssertEqual(dict.count, 4U);
2924 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2925 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2927 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2928 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2930 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2931 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2933 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2934 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2944 [dict addRawEntriesFromDictionary:dict2];
2945 XCTAssertEqual(dict.count, 4U);
2946 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
2947 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
2949 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2950 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2952 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
2953 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
2955 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
2956 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
2960 [dict release];
2975 GPBStringEnumDictionary *dict =
2980 XCTAssertNotNil(dict);
2981 XCTAssertEqual(dict.count, 3U);
2982 XCTAssertTrue(dict.validationFunc == TestingEnum_IsValidValue); // Pointer comparison
2984 XCTAssertTrue([dict getRawValue:NULL forKey:@"foo"]);
2985 XCTAssertTrue([dict getRawValue:&value forKey:@"foo"]);
2987 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
2988 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
2990 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
2991 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
2993 XCTAssertTrue([dict getRawValue:NULL forKey:@"baz"]);
2994 XCTAssertTrue([dict getRawValue:&value forKey:@"baz"]);
2996 XCTAssertFalse([dict getRawValue:NULL forKey:@"mumble"]);
3001 [dict enumerateKeysAndEnumsUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
3023 [dict enumerateKeysAndRawValuesUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
3045 [dict enumerateKeysAndRawValuesUsingBlock:^(NSString *aKey, int32_t aValue, BOOL *stop) {
3051 [dict release];
3116 GPBStringEnumDictionary *dict =
3121 XCTAssertNotNil(dict);
3123 GPBStringEnumDictionary *dict2 = [dict copy];
3127 XCTAssertNotEqual(dict, dict2);
3128 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3129 XCTAssertEqualObjects(dict, dict2);
3132 [dict release];
3138 GPBStringEnumDictionary *dict =
3143 XCTAssertNotNil(dict);
3146 [[GPBStringEnumDictionary alloc] initWithDictionary:dict];
3150 XCTAssertNotEqual(dict, dict2);
3151 XCTAssertEqualObjects(dict, dict2);
3152 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3154 [dict release];
3158 GPBStringEnumDictionary *dict =
3160 XCTAssertNotNil(dict);
3162 XCTAssertEqual(dict.count, 0U);
3163 XCTAssertThrowsSpecificNamed([dict setEnum:801 forKey:@"bar"], // Unknown
3165 XCTAssertEqual(dict.count, 0U);
3166 [dict setRawValue:801 forKey:@"bar"]; // Unknown
3167 XCTAssertEqual(dict.count, 1U);
3176 [dict addRawEntriesFromDictionary:dict2];
3177 XCTAssertEqual(dict.count, 4U);
3180 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3181 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3183 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
3184 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
3186 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
3187 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
3189 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3190 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3192 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
3193 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
3195 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3196 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3199 [dict release];
3205 GPBStringEnumDictionary *dict =
3210 XCTAssertNotNil(dict);
3211 XCTAssertEqual(dict.count, 4U);
3213 [dict removeEnumForKey:@"bar"];
3214 XCTAssertEqual(dict.count, 3U);
3216 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3217 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3219 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
3220 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3221 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3223 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3224 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3228 [dict removeEnumForKey:@"bar"];
3229 XCTAssertEqual(dict.count, 3U);
3230 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3231 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3233 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
3234 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3235 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3237 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3238 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3241 [dict removeEnumForKey:@"mumble"];
3242 XCTAssertEqual(dict.count, 2U);
3243 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3244 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3246 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
3247 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3248 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3250 XCTAssertFalse([dict getEnum:NULL forKey:@"mumble"]);
3252 [dict removeAll];
3253 XCTAssertEqual(dict.count, 0U);
3254 XCTAssertFalse([dict getEnum:NULL forKey:@"foo"]);
3255 XCTAssertFalse([dict getEnum:NULL forKey:@"bar"]);
3256 XCTAssertFalse([dict getEnum:NULL forKey:@"baz"]);
3257 XCTAssertFalse([dict getEnum:NULL forKey:@"mumble"]);
3258 [dict release];
3264 GPBStringEnumDictionary *dict =
3269 XCTAssertNotNil(dict);
3270 XCTAssertEqual(dict.count, 4U);
3272 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3273 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3275 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
3276 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
3278 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3279 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3281 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3282 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3285 XCTAssertThrowsSpecificNamed([dict setEnum:803 forKey:@"foo"], // Unknown
3287 XCTAssertEqual(dict.count, 4U);
3288 XCTAssertTrue([dict getEnum:NULL forKey:@"foo"]);
3289 XCTAssertTrue([dict getEnum:&value forKey:@"foo"]);
3291 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
3292 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
3294 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3295 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3297 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3298 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3301 [dict setRawValue:803 forKey:@"foo"]; // Unknown
3302 XCTAssertEqual(dict.count, 4U);
3303 XCTAssertTrue([dict getRawValue:NULL forKey:@"foo"]);
3304 XCTAssertTrue([dict getRawValue:&value forKey:@"foo"]);
3306 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
3307 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
3309 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3310 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3312 XCTAssertTrue([dict getRawValue:NULL forKey:@"mumble"]);
3313 XCTAssertTrue([dict getRawValue:&value forKey:@"mumble"]);
3316 [dict setRawValue:700 forKey:@"mumble"];
3317 XCTAssertEqual(dict.count, 4U);
3318 XCTAssertTrue([dict getRawValue:NULL forKey:@"foo"]);
3319 XCTAssertTrue([dict getRawValue:&value forKey:@"foo"]);
3321 XCTAssertTrue([dict getRawValue:NULL forKey:@"bar"]);
3322 XCTAssertTrue([dict getRawValue:&value forKey:@"bar"]);
3324 XCTAssertTrue([dict getEnum:NULL forKey:@"baz"]);
3325 XCTAssertTrue([dict getEnum:&value forKey:@"baz"]);
3327 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
3328 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
3339 [dict addRawEntriesFromDictionary:dict2];
3340 XCTAssertEqual(dict.count, 4U);
3341 XCTAssertTrue([dict getRawValue:NULL forKey:@"foo"]);
3342 XCTAssertTrue([dict getRawValue:&value forKey:@"foo"]);
3344 XCTAssertTrue([dict getEnum:NULL forKey:@"bar"]);
3345 XCTAssertTrue([dict getEnum:&value forKey:@"bar"]);
3347 XCTAssertTrue([dict getRawValue:NULL forKey:@"baz"]);
3348 XCTAssertTrue([dict getRawValue:&value forKey:@"baz"]);
3350 XCTAssertTrue([dict getEnum:NULL forKey:@"mumble"]);
3351 XCTAssertTrue([dict getEnum:&value forKey:@"mumble"]);
3355 [dict release];
3361 GPBStringEnumDictionary *dict =
3366 XCTAssertNotNil(dict);
3368 GPBStringEnumDictionary *dict2 = [dict copy];
3372 XCTAssertNotEqual(dict, dict2);
3373 XCTAssertEqualObjects(dict, dict2);
3374 XCTAssertEqual(dict.validationFunc, dict2.validationFunc); // Pointer comparison
3378 [dict release];