OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2011 Google Inc. All rights reserved. | 2 // Copyright 2011 Google Inc. All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 extensions 90 to 94; | 105 extensions 90 to 94; |
106 | 106 |
107 } | 107 } |
108 | 108 |
109 enum retain { | 109 enum retain { |
110 count = 4; | 110 count = 4; |
111 initialized = 5; | 111 initialized = 5; |
112 serializedSize = 6; | 112 serializedSize = 6; |
113 } | 113 } |
114 | 114 |
| 115 message ObjCPropertyNaming { |
| 116 // Test that the properties properly get things all caps. |
| 117 optional string url = 1; |
| 118 optional string thumbnail_url = 2; |
| 119 optional string url_foo = 3; |
| 120 optional string some_url_blah = 4; |
| 121 optional string http = 5; |
| 122 optional string https = 6; |
| 123 // This one doesn't. |
| 124 repeated string urls = 7; |
| 125 } |
| 126 |
115 // EnumValueShortName: The short names shouldn't get suffixes/prefixes. | 127 // EnumValueShortName: The short names shouldn't get suffixes/prefixes. |
116 enum Foo { | 128 enum Foo { |
117 SERIALIZED_SIZE = 1; | 129 SERIALIZED_SIZE = 1; |
118 SIZE = 2; | 130 SIZE = 2; |
119 OTHER = 3; | 131 OTHER = 3; |
120 } | 132 } |
121 | 133 |
122 // EnumValueShortName: The enum name gets a prefix. | 134 // EnumValueShortName: The enum name gets a prefix. |
123 enum Category { | 135 enum Category { |
124 RED = 1; | 136 RED = 1; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 TWO = 2; | 394 TWO = 2; |
383 NEG_ONE = -1; | 395 NEG_ONE = -1; |
384 NEG_TWO = -2; | 396 NEG_TWO = -2; |
385 } | 397 } |
386 optional MyEnum foo = 1; | 398 optional MyEnum foo = 1; |
387 optional MyEnum bar = 2 [default = ONE]; | 399 optional MyEnum bar = 2 [default = ONE]; |
388 optional MyEnum baz = 3 [default = NEG_ONE]; | 400 optional MyEnum baz = 3 [default = NEG_ONE]; |
389 | 401 |
390 repeated MyEnum mumble = 4; | 402 repeated MyEnum mumble = 4; |
391 } | 403 } |
| 404 |
| 405 // Test case for https://github.com/google/protobuf/issues/1453 |
| 406 // Message with no explicit defaults, but a non zero default for an enum. |
| 407 message MessageWithOneBasedEnum { |
| 408 enum OneBasedEnum { |
| 409 ONE = 1; |
| 410 TWO = 2; |
| 411 } |
| 412 optional OneBasedEnum enum_field = 1; |
| 413 } |
| 414 |
| 415 // Message with all bools for testing things related to bool storage. |
| 416 message BoolOnlyMessage { |
| 417 optional bool bool_field_1 = 1; |
| 418 optional bool bool_field_2 = 2; |
| 419 optional bool bool_field_3 = 3; |
| 420 optional bool bool_field_4 = 4; |
| 421 optional bool bool_field_5 = 5; |
| 422 optional bool bool_field_6 = 6; |
| 423 optional bool bool_field_7 = 7; |
| 424 optional bool bool_field_8 = 8; |
| 425 optional bool bool_field_9 = 9; |
| 426 optional bool bool_field_10 = 10; |
| 427 optional bool bool_field_11 = 11; |
| 428 optional bool bool_field_12 = 12; |
| 429 optional bool bool_field_13 = 13; |
| 430 optional bool bool_field_14 = 14; |
| 431 optional bool bool_field_15 = 15; |
| 432 optional bool bool_field_16 = 16; |
| 433 optional bool bool_field_17 = 17; |
| 434 optional bool bool_field_18 = 18; |
| 435 optional bool bool_field_19 = 19; |
| 436 optional bool bool_field_20 = 20; |
| 437 optional bool bool_field_21 = 21; |
| 438 optional bool bool_field_22 = 22; |
| 439 optional bool bool_field_23 = 23; |
| 440 optional bool bool_field_24 = 24; |
| 441 optional bool bool_field_25 = 25; |
| 442 optional bool bool_field_26 = 26; |
| 443 optional bool bool_field_27 = 27; |
| 444 optional bool bool_field_28 = 28; |
| 445 optional bool bool_field_29 = 29; |
| 446 optional bool bool_field_30 = 30; |
| 447 optional bool bool_field_31 = 31; |
| 448 optional bool bool_field_32 = 32; |
| 449 } |
OLD | NEW |