unittest_runtime_proto2.proto 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. // Protocol Buffers - Google's data interchange format
  2. // Copyright 2015 Google Inc. All rights reserved.
  3. //
  4. // Redistribution and use in source and binary forms, with or without
  5. // modification, are permitted provided that the following conditions are
  6. // met:
  7. //
  8. // * Redistributions of source code must retain the above copyright
  9. // notice, this list of conditions and the following disclaimer.
  10. // * Redistributions in binary form must reproduce the above
  11. // copyright notice, this list of conditions and the following disclaimer
  12. // in the documentation and/or other materials provided with the
  13. // distribution.
  14. // * Neither the name of Google Inc. nor the names of its
  15. // contributors may be used to endorse or promote products derived from
  16. // this software without specific prior written permission.
  17. //
  18. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. syntax = "proto2";
  30. package protobuf_unittest;
  31. message Message2 {
  32. enum Enum {
  33. FOO = 0;
  34. BAR = 1;
  35. BAZ = 2;
  36. EXTRA_2 = 20;
  37. }
  38. optional int32 optional_int32 = 1;
  39. optional int64 optional_int64 = 2;
  40. optional uint32 optional_uint32 = 3;
  41. optional uint64 optional_uint64 = 4;
  42. optional sint32 optional_sint32 = 5;
  43. optional sint64 optional_sint64 = 6;
  44. optional fixed32 optional_fixed32 = 7;
  45. optional fixed64 optional_fixed64 = 8;
  46. optional sfixed32 optional_sfixed32 = 9;
  47. optional sfixed64 optional_sfixed64 = 10;
  48. optional float optional_float = 11;
  49. optional double optional_double = 12;
  50. optional bool optional_bool = 13;
  51. optional string optional_string = 14;
  52. optional bytes optional_bytes = 15;
  53. optional group OptionalGroup = 16 {
  54. optional int32 a = 17;
  55. }
  56. optional Message2 optional_message = 18;
  57. optional Enum optional_enum = 19;
  58. repeated int32 repeated_int32 = 31;
  59. repeated int64 repeated_int64 = 32;
  60. repeated uint32 repeated_uint32 = 33;
  61. repeated uint64 repeated_uint64 = 34;
  62. repeated sint32 repeated_sint32 = 35;
  63. repeated sint64 repeated_sint64 = 36;
  64. repeated fixed32 repeated_fixed32 = 37;
  65. repeated fixed64 repeated_fixed64 = 38;
  66. repeated sfixed32 repeated_sfixed32 = 39;
  67. repeated sfixed64 repeated_sfixed64 = 40;
  68. repeated float repeated_float = 41;
  69. repeated double repeated_double = 42;
  70. repeated bool repeated_bool = 43;
  71. repeated string repeated_string = 44;
  72. repeated bytes repeated_bytes = 45;
  73. repeated group RepeatedGroup = 46 {
  74. optional int32 a = 47;
  75. }
  76. repeated Message2 repeated_message = 48;
  77. repeated Enum repeated_enum = 49;
  78. oneof o {
  79. int32 oneof_int32 = 51 [default = 100];
  80. int64 oneof_int64 = 52 [default = 101];
  81. uint32 oneof_uint32 = 53 [default = 102];
  82. uint64 oneof_uint64 = 54 [default = 103];
  83. sint32 oneof_sint32 = 55 [default = 104];
  84. sint64 oneof_sint64 = 56 [default = 105];
  85. fixed32 oneof_fixed32 = 57 [default = 106];
  86. fixed64 oneof_fixed64 = 58 [default = 107];
  87. sfixed32 oneof_sfixed32 = 59 [default = 108];
  88. sfixed64 oneof_sfixed64 = 60 [default = 109];
  89. float oneof_float = 61 [default = 110];
  90. double oneof_double = 62 [default = 111];
  91. bool oneof_bool = 63 [default = true];
  92. string oneof_string = 64 [default = "string"];
  93. bytes oneof_bytes = 65 [default = "data"];
  94. group OneofGroup = 66 {
  95. optional int32 a = 67;
  96. optional int32 b = 167;
  97. }
  98. Message2 oneof_message = 68;
  99. Enum oneof_enum = 69 [default = BAZ];
  100. }
  101. // Some token map cases, too many combinations to list them all.
  102. map<int32 , int32 > map_int32_int32 = 70;
  103. map<int64 , int64 > map_int64_int64 = 71;
  104. map<uint32 , uint32 > map_uint32_uint32 = 72;
  105. map<uint64 , uint64 > map_uint64_uint64 = 73;
  106. map<sint32 , sint32 > map_sint32_sint32 = 74;
  107. map<sint64 , sint64 > map_sint64_sint64 = 75;
  108. map<fixed32 , fixed32 > map_fixed32_fixed32 = 76;
  109. map<fixed64 , fixed64 > map_fixed64_fixed64 = 77;
  110. map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 78;
  111. map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 79;
  112. map<int32 , float > map_int32_float = 80;
  113. map<int32 , double > map_int32_double = 81;
  114. map<bool , bool > map_bool_bool = 82;
  115. map<string , string > map_string_string = 83;
  116. map<string , bytes > map_string_bytes = 84;
  117. map<string , Message2> map_string_message = 85;
  118. map<int32 , bytes > map_int32_bytes = 86;
  119. map<int32 , Enum > map_int32_enum = 87;
  120. map<int32 , Message2> map_int32_message = 88;
  121. }