File: unittest_objc.proto

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (881 lines) | stat: -rw-r--r-- 34,239 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
// Protocol Buffers - Google's data interchange format
// Copyright 2011 Google Inc.  All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

syntax = "proto2";

package objc.protobuf.tests;

import "google/protobuf/any.proto";
import "objectivec/Tests/unittest.proto";

// Explicit empty prefix, tests some validations code paths also.
option objc_class_prefix = "";

// Used to check that Headerdocs and appledoc work correctly. If these comments
// are not handled correctly, Xcode will fail to build the tests.
message TestGeneratedComments {
  // This is a string that could contain stuff like
  // mime types as image/* or */plain. Maybe twitter usernames
  // like @protobuf, @google or @something.
  optional string string_field = 1;
}

// Using the messages in unittest.proto, setup for recursive cases for testing
// extensions at various depths.
extend TestAllExtensions {
  optional TestAllExtensions recursive_extension = 86;
}

// Recursive message to for testing autocreators at different depths.
message TestRecursiveMessageWithRepeatedField {
  optional TestRecursiveMessageWithRepeatedField a = 1;
  repeated int32 i = 2;
  repeated string str = 3;
  map<int32, int32> i_to_i = 4;
  map<string, string> str_to_str = 5;
}

// Message with a few types of maps to cover the different custom flows
// in the runtime.
message TestMessageOfMaps {
  map<string, string> str_to_str = 1;

  map<string, int32> str_to_int = 2;
  map<int32, string> int_to_str = 3;
  map<int32, int32> int_to_int = 4;

  map<string, bool> str_to_bool = 5;
  map<bool, string> bool_to_str = 6;
  map<bool, bool> bool_to_bool = 7;

  map<int32, bool> int_to_bool = 8;
  map<bool, int32> bool_to_int = 9;

  map<string, TestAllTypes> str_to_msg = 10;
  map<int32, TestAllTypes> int_to_msg = 11;
  map<bool, TestAllTypes> bool_to_msg = 12;
}

// Recursive message and extension to for testing autocreators at different
// depths.
message TestRecursiveExtension {
  optional TestRecursiveExtension recursive_sub_message = 1;
  repeated int32 repeated_value = 2;
  extensions 1000 to max;
}

extend TestRecursiveExtension {
  optional TestRecursiveExtension recursive_message_extension = 1000;
}

message self {
  message super {
    optional int32 description = 1;
  }

  enum autorelease {
    retain = 1;
    release = 2;
    retainCount = 3;
  }

  // Singular
  // Objective C Keywords
  optional bool id = 1;
  optional bool _cmd = 2;
  // super is used as submessage above
  optional bool in = 4;
  optional bool out = 5;
  optional bool inout = 6;
  optional bool bycopy = 7;
  optional bool byref = 8;
  optional bool oneway = 9;
  optional bool self = 10;
  optional bool instancetype = 11;
  optional bool nullable = 12;
  optional bool nonnull = 13;
  optional bool nil = 14;
  // Nil and nil can't be in the same message
  optional bool YES = 16;
  optional bool NO = 17;
  optional bool weak = 18;

  // Some C/C++ Keywords
  optional bool case = 30;
  optional bool if = 31;
  optional bool and_eq = 32;
  optional bool public = 33;
  optional bool private = 34;
  optional bool typename = 35;
  optional bool static_cast = 36;
  optional bool typeof = 37;
  optional bool restrict = 38;
  optional bool NULL = 39;

  // Some NSObject Methods
  optional bool dealloc = 110;
  optional bool isProxy = 111;
  optional bool copy = 112;
  optional bool description = 113;
  optional bool zone = 114;
  optional bool className = 115;
  optional bool __retain_OA = 116;
  optional bool CAMLType = 117;
  optional bool isNSDictionary__ = 118;
  optional bool accessibilityLabel = 119;

  // Some Objc "keywords" that we shouldn't
  // have to worry about because they
  // can only appear in specialized areas.
  optional bool assign = 200;
  optional bool getter = 201;
  optional bool setter = 202;
  optional bool atomic = 203;
  optional bool nonatomic = 204;
  optional bool strong = 205;
  optional bool null_resettable = 206;
  optional bool readonly = 207;

  // Some GPBMessage methods
  optional bool clear = 300;
  optional bool data = 301;
  optional bool descriptor = 302;
  optional bool delimitedData = 303;

  // Some MacTypes
  optional bool Fixed = 400;
  optional bool Point = 401;
  optional bool FixedPoint = 402;
  optional bool Style = 403;

  // C/C++ reserved identifiers
  optional bool _Generic = 500;
  optional bool __block = 501;

  // Try a keyword as a type
  optional autorelease SubEnum = 1000;

  optional group New = 2000 {
    optional string copy = 1;
  }
  optional group MutableCopy = 2001 {
    optional int32 extensionRegistry = 1;
  }

  extensions 3000 to 3999;
}

enum retain {
  count = 4;
  initialized = 5;
  serializedSize = 6;
}

message ObjCPropertyNaming {
  // Test that the properties properly get things all caps.
  optional string url = 1;
  optional string thumbnail_url = 2;
  optional string url_foo = 3;
  optional string some_url_blah = 4;
  optional string http = 5;
  optional string https = 6;
  // This one doesn't.
  repeated string urls = 7;
}

// EnumValueShortName: The short names shouldn't get suffixes/prefixes.
enum Foo {
  SERIALIZED_SIZE = 1;
  SIZE = 2;
  OTHER = 3;
}

// EnumValueShortName: The enum name gets a prefix.
enum Category {
  RED = 1;
  BLUE = 2;
}

// EnumValueShortName: Twist case, full name gets PB, but the short names
// should still end up correct.
enum Time {
  BASE = 1;
  RECORD = 2;
  SOMETHING_ELSE = 3;
}

extend self {
  repeated int32 debugDescription = 3000 [packed = true];
  repeated int64 finalize = 3001 [packed = true];
  repeated uint32 hash = 3002 [packed = true];
  repeated uint64 classForCoder = 3003 [packed = true];
  repeated sint32 byref = 3004 [packed = true];
}

// Test handing of fields that start with init*.
message ObjCInitFoo {
  optional string init_val = 11;
  optional int32 init_size = 12;
  optional self init_self = 13;

  repeated string init_vals = 21;
  repeated int32 init_sizes = 22;
  repeated self init_selfs = 23;
}

// Test handling of fields that start with retained names.
message ObjCRetainedFoo {
  optional string new_val_lower_complex = 11;
  optional string new_Val_upper_complex = 12;
  optional string newvalue_lower_no_underscore_complex = 13;
  optional string newValue_upper_no_underscore_complex = 14;

  optional int32 new_val_lower_primitive = 15;
  optional int32 new_Val_upper_primitive = 16;
  optional int32 newvalue_lower_no_underscore_primitive = 17;
  optional int32 newValue_upper_no_underscore_primitive = 18;

  optional self new_val_lower_message = 19;
  optional self new_Val_upper_message = 20;
  optional self newvalue_lower_no_underscore_message = 21;
  optional self newValue_upper_no_underscore_message = 22;

  optional Foo new_val_lower_enum = 23;
  optional Foo new_Val_upper_enum = 24;
  optional Foo newvalue_lower_no_underscore_enum = 25;
  optional Foo newValue_upper_no_underscore_enum = 26;

  repeated string new_val_lower_complex_repeated = 111;
  repeated string new_Val_upper_complex_repeated = 112;
  repeated string newvalue_lower_no_underscore_complex_repeated = 113;
  repeated string newValue_upper_no_underscore_complex_repeated = 114;

  repeated int32 new_val_lower_primitive_repeated = 115;
  repeated int32 new_Val_upper_primitive_repeated = 116;
  repeated int32 newvalue_lower_no_underscore_primitive_repeated = 117;
  repeated int32 newValue_upper_no_underscore_primitive_repeated = 118;

  repeated self new_val_lower_message_repeated = 119;
  repeated self new_Val_upper_message_repeated = 120;
  repeated self newvalue_lower_no_underscore_message_repeated = 121;
  repeated self newValue_upper_no_underscore_message_repeated = 122;

  repeated Foo new_val_lower_enum_repeated = 123;
  repeated Foo new_Val_upper_enum_repeated = 124;
  repeated Foo newvalue_lower_no_underscore_enum_repeated = 125;
  repeated Foo newValue_upper_no_underscore_enum_repeated = 126;

  optional string alloc_val_lower_complex = 211;
  optional string alloc_Val_upper_complex = 212;
  optional string allocvalue_lower_no_underscore_complex = 213;
  optional string allocValue_upper_no_underscore_complex = 214;

  optional int32 alloc_val_lower_primitive = 215;
  optional int32 alloc_Val_upper_primitive = 216;
  optional int32 allocvalue_lower_no_underscore_primitive = 217;
  optional int32 allocValue_upper_no_underscore_primitive = 218;

  optional self alloc_val_lower_message = 219;
  optional self alloc_Val_upper_message = 220;
  optional self allocvalue_lower_no_underscore_message = 221;
  optional self allocValue_upper_no_underscore_message = 222;

  optional Foo alloc_val_lower_enum = 223;
  optional Foo alloc_Val_upper_enum = 224;
  optional Foo allocvalue_lower_no_underscore_enum = 225;
  optional Foo allocValue_upper_no_underscore_enum = 226;

  repeated string alloc_val_lower_complex_repeated = 311;
  repeated string alloc_Val_upper_complex_repeated = 312;
  repeated string allocvalue_lower_no_underscore_complex_repeated = 313;
  repeated string allocValue_upper_no_underscore_complex_repeated = 314;

  repeated int32 alloc_val_lower_primitive_repeated = 315;
  repeated int32 alloc_Val_upper_primitive_repeated = 316;
  repeated int32 allocvalue_lower_no_underscore_primitive_repeated = 317;
  repeated int32 allocValue_upper_no_underscore_primitive_repeated = 318;

  repeated self alloc_val_lower_message_repeated = 319;
  repeated self alloc_Val_upper_message_repeated = 320;
  repeated self allocvalue_lower_no_underscore_message_repeated = 321;
  repeated self allocValue_upper_no_underscore_message_repeated = 322;

  repeated Foo alloc_val_lower_enum_repeated = 323;
  repeated Foo alloc_Val_upper_enum_repeated = 324;
  repeated Foo allocvalue_lower_no_underscore_enum_repeated = 325;
  repeated Foo allocValue_upper_no_underscore_enum_repeated = 326;

  optional string copy_val_lower_complex = 411;
  optional string copy_Val_upper_complex = 412;
  optional string copyvalue_lower_no_underscore_complex = 413;
  optional string copyValue_upper_no_underscore_complex = 414;

  optional int32 copy_val_lower_primitive = 415;
  optional int32 copy_Val_upper_primitive = 416;
  optional int32 copyvalue_lower_no_underscore_primitive = 417;
  optional int32 copyValue_upper_no_underscore_primitive = 418;

  optional self copy_val_lower_message = 419;
  optional self copy_Val_upper_message = 420;
  optional self copyvalue_lower_no_underscore_message = 421;
  optional self copyValue_upper_no_underscore_message = 422;

  optional Foo copy_val_lower_enum = 423;
  optional Foo copy_Val_upper_enum = 424;
  optional Foo copyvalue_lower_no_underscore_enum = 425;
  optional Foo copyValue_upper_no_underscore_enum = 426;

  repeated string copy_val_lower_complex_repeated = 511;
  repeated string copy_Val_upper_complex_repeated = 512;
  repeated string copyvalue_lower_no_underscore_complex_repeated = 513;
  repeated string copyValue_upper_no_underscore_complex_repeated = 514;

  repeated int32 copy_val_lower_primitive_repeated = 515;
  repeated int32 copy_Val_upper_primitive_repeated = 516;
  repeated int32 copyvalue_lower_no_underscore_primitive_repeated = 517;
  repeated int32 copyValue_upper_no_underscore_primitive_repeated = 518;

  repeated self copy_val_lower_message_repeated = 519;
  repeated self copy_Val_upper_message_repeated = 520;
  repeated self copyvalue_lower_no_underscore_message_repeated = 521;
  repeated self copyValue_upper_no_underscore_message_repeated = 522;

  repeated Foo copy_val_lower_enum_repeated = 523;
  repeated Foo copy_Val_upper_enum_repeated = 524;
  repeated Foo copyvalue_lower_no_underscore_enum_repeated = 525;
  repeated Foo copyValue_upper_no_underscore_enum_repeated = 526;

  optional string mutableCopy_val_lower_complex = 611;
  optional string mutableCopy_Val_upper_complex = 612;
  optional string mutableCopyvalue_lower_no_underscore_complex = 613;
  optional string mutableCopyValue_upper_no_underscore_complex = 614;

  optional int32 mutableCopy_val_lower_primitive = 615;
  optional int32 mutableCopy_Val_upper_primitive = 616;
  optional int32 mutableCopyvalue_lower_no_underscore_primitive = 617;
  optional int32 mutableCopyValue_upper_no_underscore_primitive = 618;

  optional self mutableCopy_val_lower_message = 619;
  optional self mutableCopy_Val_upper_message = 620;
  optional self mutableCopyvalue_lower_no_underscore_message = 621;
  optional self mutableCopyValue_upper_no_underscore_message = 622;

  optional Foo mutableCopy_val_lower_enum = 623;
  optional Foo mutableCopy_Val_upper_enum = 624;
  optional Foo mutableCopyvalue_lower_no_underscore_enum = 625;
  optional Foo mutableCopyValue_upper_no_underscore_enum = 626;

  repeated string mutableCopy_val_lower_complex_repeated = 711;
  repeated string mutableCopy_Val_upper_complex_repeated = 712;
  repeated string mutableCopyvalue_lower_no_underscore_complex_repeated = 713;
  repeated string mutableCopyValue_upper_no_underscore_complex_repeated = 714;

  repeated int32 mutableCopy_val_lower_primitive_repeated = 715;
  repeated int32 mutableCopy_Val_upper_primitive_repeated = 716;
  repeated int32 mutableCopyvalue_lower_no_underscore_primitive_repeated = 717;
  repeated int32 mutableCopyValue_upper_no_underscore_primitive_repeated = 718;

  repeated self mutableCopy_val_lower_message_repeated = 719;
  repeated self mutableCopy_Val_upper_message_repeated = 720;
  repeated self mutableCopyvalue_lower_no_underscore_message_repeated = 721;
  repeated self mutableCopyValue_upper_no_underscore_message_repeated = 722;

  repeated Foo mutableCopy_val_lower_enum_repeated = 723;
  repeated Foo mutableCopy_Val_upper_enum_repeated = 724;
  repeated Foo mutableCopyvalue_lower_no_underscore_enum_repeated = 725;
  repeated Foo mutableCopyValue_upper_no_underscore_enum_repeated = 726;

  extensions 1000 to 3999;
}

// Extension fields with retained names.
extend ObjCRetainedFoo {
  optional string new_val_lower_complex = 1011;
  optional string new_Val_upper_complex = 1012;
  optional string newvalue_lower_no_underscore_complex = 1013;
  optional string newValue_upper_no_underscore_complex = 1014;

  optional int32 new_val_lower_primitive = 1015;
  optional int32 new_Val_upper_primitive = 1016;
  optional int32 newvalue_lower_no_underscore_primitive = 1017;
  optional int32 newValue_upper_no_underscore_primitive = 1018;

  optional self new_val_lower_message = 1019;
  optional self new_Val_upper_message = 1020;
  optional self newvalue_lower_no_underscore_message = 1021;
  optional self newValue_upper_no_underscore_message = 1022;

  optional Foo new_val_lower_enum = 1023;
  optional Foo new_Val_upper_enum = 1024;
  optional Foo newvalue_lower_no_underscore_enum = 1025;
  optional Foo newValue_upper_no_underscore_enum = 1026;

  repeated string new_val_lower_complex_repeated = 1111;
  repeated string new_Val_upper_complex_repeated = 1112;
  repeated string newvalue_lower_no_underscore_complex_repeated = 1113;
  repeated string newValue_upper_no_underscore_complex_repeated = 1114;

  repeated int32 new_val_lower_primitive_repeated = 1115;
  repeated int32 new_Val_upper_primitive_repeated = 1116;
  repeated int32 newvalue_lower_no_underscore_primitive_repeated = 1117;
  repeated int32 newValue_upper_no_underscore_primitive_repeated = 1118;

  repeated self new_val_lower_message_repeated = 1119;
  repeated self new_Val_upper_message_repeated = 1120;
  repeated self newvalue_lower_no_underscore_message_repeated = 1121;
  repeated self newValue_upper_no_underscore_message_repeated = 1122;

  repeated Foo new_val_lower_enum_repeated = 1123;
  repeated Foo new_Val_upper_enum_repeated = 1124;
  repeated Foo newvalue_lower_no_underscore_enum_repeated = 1125;
  repeated Foo newValue_upper_no_underscore_enum_repeated = 1126;

  optional string alloc_val_lower_complex = 1211;
  optional string alloc_Val_upper_complex = 1212;
  optional string allocvalue_lower_no_underscore_complex = 1213;
  optional string allocValue_upper_no_underscore_complex = 1214;

  optional int32 alloc_val_lower_primitive = 1215;
  optional int32 alloc_Val_upper_primitive = 1216;
  optional int32 allocvalue_lower_no_underscore_primitive = 1217;
  optional int32 allocValue_upper_no_underscore_primitive = 1218;

  optional self alloc_val_lower_message = 1219;
  optional self alloc_Val_upper_message = 1220;
  optional self allocvalue_lower_no_underscore_message = 1221;
  optional self allocValue_upper_no_underscore_message = 1222;

  optional Foo alloc_val_lower_enum = 1223;
  optional Foo alloc_Val_upper_enum = 1224;
  optional Foo allocvalue_lower_no_underscore_enum = 1225;
  optional Foo allocValue_upper_no_underscore_enum = 1226;

  repeated string alloc_val_lower_complex_repeated = 1311;
  repeated string alloc_Val_upper_complex_repeated = 1312;
  repeated string allocvalue_lower_no_underscore_complex_repeated = 1313;
  repeated string allocValue_upper_no_underscore_complex_repeated = 1314;

  repeated int32 alloc_val_lower_primitive_repeated = 1315;
  repeated int32 alloc_Val_upper_primitive_repeated = 1316;
  repeated int32 allocvalue_lower_no_underscore_primitive_repeated = 1317;
  repeated int32 allocValue_upper_no_underscore_primitive_repeated = 1318;

  repeated self alloc_val_lower_message_repeated = 1319;
  repeated self alloc_Val_upper_message_repeated = 1320;
  repeated self allocvalue_lower_no_underscore_message_repeated = 1321;
  repeated self allocValue_upper_no_underscore_message_repeated = 1322;

  repeated Foo alloc_val_lower_enum_repeated = 1323;
  repeated Foo alloc_Val_upper_enum_repeated = 1324;
  repeated Foo allocvalue_lower_no_underscore_enum_repeated = 1325;
  repeated Foo allocValue_upper_no_underscore_enum_repeated = 1326;

  optional string copy_val_lower_complex = 1411;
  optional string copy_Val_upper_complex = 1412;
  optional string copyvalue_lower_no_underscore_complex = 1413;
  optional string copyValue_upper_no_underscore_complex = 1414;

  optional int32 copy_val_lower_primitive = 1415;
  optional int32 copy_Val_upper_primitive = 1416;
  optional int32 copyvalue_lower_no_underscore_primitive = 1417;
  optional int32 copyValue_upper_no_underscore_primitive = 1418;

  optional self copy_val_lower_message = 1419;
  optional self copy_Val_upper_message = 1420;
  optional self copyvalue_lower_no_underscore_message = 1421;
  optional self copyValue_upper_no_underscore_message = 1422;

  optional Foo copy_val_lower_enum = 1423;
  optional Foo copy_Val_upper_enum = 1424;
  optional Foo copyvalue_lower_no_underscore_enum = 1425;
  optional Foo copyValue_upper_no_underscore_enum = 1426;

  repeated string copy_val_lower_complex_repeated = 1511;
  repeated string copy_Val_upper_complex_repeated = 1512;
  repeated string copyvalue_lower_no_underscore_complex_repeated = 1513;
  repeated string copyValue_upper_no_underscore_complex_repeated = 1514;

  repeated int32 copy_val_lower_primitive_repeated = 1515;
  repeated int32 copy_Val_upper_primitive_repeated = 1516;
  repeated int32 copyvalue_lower_no_underscore_primitive_repeated = 1517;
  repeated int32 copyValue_upper_no_underscore_primitive_repeated = 1518;

  repeated self copy_val_lower_message_repeated = 1519;
  repeated self copy_Val_upper_message_repeated = 1520;
  repeated self copyvalue_lower_no_underscore_message_repeated = 1521;
  repeated self copyValue_upper_no_underscore_message_repeated = 1522;

  repeated Foo copy_val_lower_enum_repeated = 1523;
  repeated Foo copy_Val_upper_enum_repeated = 1524;
  repeated Foo copyvalue_lower_no_underscore_enum_repeated = 1525;
  repeated Foo copyValue_upper_no_underscore_enum_repeated = 1526;

  optional string mutableCopy_val_lower_complex = 1611;
  optional string mutableCopy_Val_upper_complex = 1612;
  optional string mutableCopyvalue_lower_no_underscore_complex = 1613;
  optional string mutableCopyValue_upper_no_underscore_complex = 1614;

  optional int32 mutableCopy_val_lower_primitive = 1615;
  optional int32 mutableCopy_Val_upper_primitive = 1616;
  optional int32 mutableCopyvalue_lower_no_underscore_primitive = 1617;
  optional int32 mutableCopyValue_upper_no_underscore_primitive = 1618;

  optional self mutableCopy_val_lower_message = 1619;
  optional self mutableCopy_Val_upper_message = 1620;
  optional self mutableCopyvalue_lower_no_underscore_message = 1621;
  optional self mutableCopyValue_upper_no_underscore_message = 1622;

  optional Foo mutableCopy_val_lower_enum = 1623;
  optional Foo mutableCopy_Val_upper_enum = 1624;
  optional Foo mutableCopyvalue_lower_no_underscore_enum = 1625;
  optional Foo mutableCopyValue_upper_no_underscore_enum = 1626;

  repeated string mutableCopy_val_lower_complex_repeated = 1711;
  repeated string mutableCopy_Val_upper_complex_repeated = 1712;
  repeated string mutableCopyvalue_lower_no_underscore_complex_repeated = 1713;
  repeated string mutableCopyValue_upper_no_underscore_complex_repeated = 1714;

  repeated int32 mutableCopy_val_lower_primitive_repeated = 1715;
  repeated int32 mutableCopy_Val_upper_primitive_repeated = 1716;
  repeated int32 mutableCopyvalue_lower_no_underscore_primitive_repeated = 1717;
  repeated int32 mutableCopyValue_upper_no_underscore_primitive_repeated = 1718;

  repeated self mutableCopy_val_lower_message_repeated = 1719;
  repeated self mutableCopy_Val_upper_message_repeated = 1720;
  repeated self mutableCopyvalue_lower_no_underscore_message_repeated = 1721;
  repeated self mutableCopyValue_upper_no_underscore_message_repeated = 1722;

  repeated Foo mutableCopy_val_lower_enum_repeated = 1723;
  repeated Foo mutableCopy_Val_upper_enum_repeated = 1724;
  repeated Foo mutableCopyvalue_lower_no_underscore_enum_repeated = 1725;
  repeated Foo mutableCopyValue_upper_no_underscore_enum_repeated = 1726;
}

message JustToScopeExtensions {
  extend ObjCRetainedFoo {
    optional string new_val_lower_complex = 2011;
    optional string new_Val_upper_complex = 2012;
    optional string newvalue_lower_no_underscore_complex = 2013;
    optional string newValue_upper_no_underscore_complex = 2014;

    optional int32 new_val_lower_primitive = 2015;
    optional int32 new_Val_upper_primitive = 2016;
    optional int32 newvalue_lower_no_underscore_primitive = 2017;
    optional int32 newValue_upper_no_underscore_primitive = 2018;

    optional self new_val_lower_message = 2019;
    optional self new_Val_upper_message = 2020;
    optional self newvalue_lower_no_underscore_message = 2021;
    optional self newValue_upper_no_underscore_message = 2022;

    optional Foo new_val_lower_enum = 2023;
    optional Foo new_Val_upper_enum = 2024;
    optional Foo newvalue_lower_no_underscore_enum = 2025;
    optional Foo newValue_upper_no_underscore_enum = 2026;

    repeated string new_val_lower_complex_repeated = 2111;
    repeated string new_Val_upper_complex_repeated = 2112;
    repeated string newvalue_lower_no_underscore_complex_repeated = 2113;
    repeated string newValue_upper_no_underscore_complex_repeated = 2114;

    repeated int32 new_val_lower_primitive_repeated = 2115;
    repeated int32 new_Val_upper_primitive_repeated = 2116;
    repeated int32 newvalue_lower_no_underscore_primitive_repeated = 2117;
    repeated int32 newValue_upper_no_underscore_primitive_repeated = 2118;

    repeated self new_val_lower_message_repeated = 2119;
    repeated self new_Val_upper_message_repeated = 2120;
    repeated self newvalue_lower_no_underscore_message_repeated = 2121;
    repeated self newValue_upper_no_underscore_message_repeated = 2122;

    repeated Foo new_val_lower_enum_repeated = 2123;
    repeated Foo new_Val_upper_enum_repeated = 2124;
    repeated Foo newvalue_lower_no_underscore_enum_repeated = 2125;
    repeated Foo newValue_upper_no_underscore_enum_repeated = 2126;

    optional string alloc_val_lower_complex = 2211;
    optional string alloc_Val_upper_complex = 2212;
    optional string allocvalue_lower_no_underscore_complex = 2213;
    optional string allocValue_upper_no_underscore_complex = 2214;

    optional int32 alloc_val_lower_primitive = 2215;
    optional int32 alloc_Val_upper_primitive = 2216;
    optional int32 allocvalue_lower_no_underscore_primitive = 2217;
    optional int32 allocValue_upper_no_underscore_primitive = 2218;

    optional self alloc_val_lower_message = 2219;
    optional self alloc_Val_upper_message = 2220;
    optional self allocvalue_lower_no_underscore_message = 2221;
    optional self allocValue_upper_no_underscore_message = 2222;

    optional Foo alloc_val_lower_enum = 2223;
    optional Foo alloc_Val_upper_enum = 2224;
    optional Foo allocvalue_lower_no_underscore_enum = 2225;
    optional Foo allocValue_upper_no_underscore_enum = 2226;

    repeated string alloc_val_lower_complex_repeated = 2311;
    repeated string alloc_Val_upper_complex_repeated = 2312;
    repeated string allocvalue_lower_no_underscore_complex_repeated = 2313;
    repeated string allocValue_upper_no_underscore_complex_repeated = 2314;

    repeated int32 alloc_val_lower_primitive_repeated = 2315;
    repeated int32 alloc_Val_upper_primitive_repeated = 2316;
    repeated int32 allocvalue_lower_no_underscore_primitive_repeated = 2317;
    repeated int32 allocValue_upper_no_underscore_primitive_repeated = 2318;

    repeated self alloc_val_lower_message_repeated = 2319;
    repeated self alloc_Val_upper_message_repeated = 2320;
    repeated self allocvalue_lower_no_underscore_message_repeated = 2321;
    repeated self allocValue_upper_no_underscore_message_repeated = 2322;

    repeated Foo alloc_val_lower_enum_repeated = 2323;
    repeated Foo alloc_Val_upper_enum_repeated = 2324;
    repeated Foo allocvalue_lower_no_underscore_enum_repeated = 2325;
    repeated Foo allocValue_upper_no_underscore_enum_repeated = 2326;

    optional string copy_val_lower_complex = 2411;
    optional string copy_Val_upper_complex = 2412;
    optional string copyvalue_lower_no_underscore_complex = 2413;
    optional string copyValue_upper_no_underscore_complex = 2414;

    optional int32 copy_val_lower_primitive = 2415;
    optional int32 copy_Val_upper_primitive = 2416;
    optional int32 copyvalue_lower_no_underscore_primitive = 2417;
    optional int32 copyValue_upper_no_underscore_primitive = 2418;

    optional self copy_val_lower_message = 2419;
    optional self copy_Val_upper_message = 2420;
    optional self copyvalue_lower_no_underscore_message = 2421;
    optional self copyValue_upper_no_underscore_message = 2422;

    optional Foo copy_val_lower_enum = 2423;
    optional Foo copy_Val_upper_enum = 2424;
    optional Foo copyvalue_lower_no_underscore_enum = 2425;
    optional Foo copyValue_upper_no_underscore_enum = 2426;

    repeated string copy_val_lower_complex_repeated = 2511;
    repeated string copy_Val_upper_complex_repeated = 2512;
    repeated string copyvalue_lower_no_underscore_complex_repeated = 2513;
    repeated string copyValue_upper_no_underscore_complex_repeated = 2514;

    repeated int32 copy_val_lower_primitive_repeated = 2515;
    repeated int32 copy_Val_upper_primitive_repeated = 2516;
    repeated int32 copyvalue_lower_no_underscore_primitive_repeated = 2517;
    repeated int32 copyValue_upper_no_underscore_primitive_repeated = 2518;

    repeated self copy_val_lower_message_repeated = 2519;
    repeated self copy_Val_upper_message_repeated = 2520;
    repeated self copyvalue_lower_no_underscore_message_repeated = 2521;
    repeated self copyValue_upper_no_underscore_message_repeated = 2522;

    repeated Foo copy_val_lower_enum_repeated = 2523;
    repeated Foo copy_Val_upper_enum_repeated = 2524;
    repeated Foo copyvalue_lower_no_underscore_enum_repeated = 2525;
    repeated Foo copyValue_upper_no_underscore_enum_repeated = 2526;

    optional string mutableCopy_val_lower_complex = 2611;
    optional string mutableCopy_Val_upper_complex = 2612;
    optional string mutableCopyvalue_lower_no_underscore_complex = 2613;
    optional string mutableCopyValue_upper_no_underscore_complex = 2614;

    optional int32 mutableCopy_val_lower_primitive = 2615;
    optional int32 mutableCopy_Val_upper_primitive = 2616;
    optional int32 mutableCopyvalue_lower_no_underscore_primitive = 2617;
    optional int32 mutableCopyValue_upper_no_underscore_primitive = 2618;

    optional self mutableCopy_val_lower_message = 2619;
    optional self mutableCopy_Val_upper_message = 2620;
    optional self mutableCopyvalue_lower_no_underscore_message = 2621;
    optional self mutableCopyValue_upper_no_underscore_message = 2622;

    optional Foo mutableCopy_val_lower_enum = 2623;
    optional Foo mutableCopy_Val_upper_enum = 2624;
    optional Foo mutableCopyvalue_lower_no_underscore_enum = 2625;
    optional Foo mutableCopyValue_upper_no_underscore_enum = 2626;

    repeated string mutableCopy_val_lower_complex_repeated = 2711;
    repeated string mutableCopy_Val_upper_complex_repeated = 2712;
    repeated string mutableCopyvalue_lower_no_underscore_complex_repeated =
        2713;
    repeated string mutableCopyValue_upper_no_underscore_complex_repeated =
        2714;

    repeated int32 mutableCopy_val_lower_primitive_repeated = 2715;
    repeated int32 mutableCopy_Val_upper_primitive_repeated = 2716;
    repeated int32 mutableCopyvalue_lower_no_underscore_primitive_repeated =
        2717;
    repeated int32 mutableCopyValue_upper_no_underscore_primitive_repeated =
        2718;

    repeated self mutableCopy_val_lower_message_repeated = 2719;
    repeated self mutableCopy_Val_upper_message_repeated = 2720;
    repeated self mutableCopyvalue_lower_no_underscore_message_repeated = 2721;
    repeated self mutableCopyValue_upper_no_underscore_message_repeated = 2722;

    repeated Foo mutableCopy_val_lower_enum_repeated = 2723;
    repeated Foo mutableCopy_Val_upper_enum_repeated = 2724;
    repeated Foo mutableCopyvalue_lower_no_underscore_enum_repeated = 2725;
    repeated Foo mutableCopyValue_upper_no_underscore_enum_repeated = 2726;
  }
}

// Test handling of fields that are the retained names.
message ObjCRetainedComplex {
  optional string new = 1;
  optional string alloc = 2;
  optional string copy = 3;
  optional string mutableCopy = 4;
}

message ObjCRetainedComplexRepeated {
  repeated string new = 1;
  repeated string alloc = 2;
  repeated string copy = 3;
  repeated string mutableCopy = 4;
}

message ObjCRetainedPrimitive {
  optional int32 new = 1;
  optional int32 alloc = 2;
  optional int32 copy = 3;
  optional int32 mutableCopy = 4;
}

message ObjCRetainedPrimitiveRepeated {
  repeated int32 new = 1;
  repeated int32 alloc = 2;
  repeated int32 copy = 3;
  repeated int32 mutableCopy = 4;
}

message ObjCRetainedMessage {
  optional self new = 1;
  optional self alloc = 2;
  optional self copy = 3;
  optional self mutableCopy = 4;
}

message ObjCRetainedMessageRepeated {
  repeated self new = 1;
  repeated self alloc = 2;
  repeated self copy = 3;
  repeated self mutableCopy = 4;
}

// Test Handling some MacTypes
message Point {
  message Rect {
    optional int32 TimeValue = 1;
  }
}

// Test some weird defaults that we see in protos.
message ObjcWeirdDefaults {
  // Set default values that match the protocol buffer defined defaults to
  // confirm hasDefault and the default values are set correctly.
  optional string foo = 1 [default = ""];
  optional bytes bar = 2 [default = ""];
}

// Used to confirm negative enum values work as expected.
message EnumTestMsg {
  enum MyEnum {
    ZERO = 0;
    ONE = 1;
    TWO = 2;
    NEG_ONE = -1;
    NEG_TWO = -2;
  }
  optional MyEnum foo = 1;
  optional MyEnum bar = 2 [default = ONE];
  optional MyEnum baz = 3 [default = NEG_ONE];

  repeated MyEnum mumble = 4;
}

message EnumTestMsgPrime {
  enum MyEnumPrime {
    ZERO = 0;
    ONE = 1;
    NEG_ONE = -1;
    // Lacks 2, -2.
  }
  optional MyEnumPrime foo = 1;
  optional MyEnumPrime bar = 2 [default = ONE];
  optional MyEnumPrime baz = 3 [default = NEG_ONE];

  repeated MyEnumPrime mumble = 4;
}

// Test case for https://github.com/protocolbuffers/protobuf/issues/1453
// Message with no explicit defaults, but a non zero default for an enum.
message MessageWithOneBasedEnum {
  enum OneBasedEnum {
    ONE = 1;
    TWO = 2;
  }
  optional OneBasedEnum enum_field = 1;
}

// Message with all bools for testing things related to bool storage.
message BoolOnlyMessage {
  optional bool bool_field_1 = 1;
  optional bool bool_field_2 = 2;
  optional bool bool_field_3 = 3;
  optional bool bool_field_4 = 4;
  optional bool bool_field_5 = 5;
  optional bool bool_field_6 = 6;
  optional bool bool_field_7 = 7;
  optional bool bool_field_8 = 8;
  optional bool bool_field_9 = 9;
  optional bool bool_field_10 = 10;
  optional bool bool_field_11 = 11;
  optional bool bool_field_12 = 12;
  optional bool bool_field_13 = 13;
  optional bool bool_field_14 = 14;
  optional bool bool_field_15 = 15;
  optional bool bool_field_16 = 16;
  optional bool bool_field_17 = 17;
  optional bool bool_field_18 = 18;
  optional bool bool_field_19 = 19;
  optional bool bool_field_20 = 20;
  optional bool bool_field_21 = 21;
  optional bool bool_field_22 = 22;
  optional bool bool_field_23 = 23;
  optional bool bool_field_24 = 24;
  optional bool bool_field_25 = 25;
  optional bool bool_field_26 = 26;
  optional bool bool_field_27 = 27;
  optional bool bool_field_28 = 28;
  optional bool bool_field_29 = 29;
  optional bool bool_field_30 = 30;
  optional bool bool_field_31 = 31;
  optional bool bool_field_32 = 32;
}

// Reference to a WKT to test (via generated code inspection), the handling
// of #imports.  Within the WKTs, references to each other are just path
// based imports, but when reference from another proto file, they should be
// conditional to support the framework import style.
message WKTReferenceMessage {
  optional google.protobuf.Any an_any = 1;
}

// This is in part a compile test, it ensures that when aliases end up with
// the same ObjC name, we drop them to avoid the duplication names. There
// is a test to ensure the descriptors are still generated to support
// reflection and TextFormat.
enum TestEnumObjCNameCollision {
  option allow_alias = true;

  FOO = 1;
  foo = 1;

  BAR = 2;
  mumble = 2;
  MUMBLE = 2;
}