unittest_runtime_proto3.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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 = "proto3";
  30. package protobuf_unittest;
  31. message Message3 {
  32. enum Enum {
  33. FOO = 0;
  34. BAR = 1;
  35. BAZ = 2;
  36. EXTRA_3 = 30;
  37. }
  38. int32 optional_int32 = 1;
  39. int64 optional_int64 = 2;
  40. uint32 optional_uint32 = 3;
  41. uint64 optional_uint64 = 4;
  42. sint32 optional_sint32 = 5;
  43. sint64 optional_sint64 = 6;
  44. fixed32 optional_fixed32 = 7;
  45. fixed64 optional_fixed64 = 8;
  46. sfixed32 optional_sfixed32 = 9;
  47. sfixed64 optional_sfixed64 = 10;
  48. float optional_float = 11;
  49. double optional_double = 12;
  50. bool optional_bool = 13;
  51. string optional_string = 14;
  52. bytes optional_bytes = 15;
  53. // No 'group' in proto3.
  54. Message3 optional_message = 18;
  55. Enum optional_enum = 19;
  56. repeated int32 repeated_int32 = 31;
  57. repeated int64 repeated_int64 = 32;
  58. repeated uint32 repeated_uint32 = 33;
  59. repeated uint64 repeated_uint64 = 34;
  60. repeated sint32 repeated_sint32 = 35;
  61. repeated sint64 repeated_sint64 = 36;
  62. repeated fixed32 repeated_fixed32 = 37;
  63. repeated fixed64 repeated_fixed64 = 38;
  64. repeated sfixed32 repeated_sfixed32 = 39;
  65. repeated sfixed64 repeated_sfixed64 = 40;
  66. repeated float repeated_float = 41;
  67. repeated double repeated_double = 42;
  68. repeated bool repeated_bool = 43;
  69. repeated string repeated_string = 44;
  70. repeated bytes repeated_bytes = 45;
  71. // No 'group' in proto3.
  72. repeated Message3 repeated_message = 48;
  73. repeated Enum repeated_enum = 49;
  74. oneof o {
  75. int32 oneof_int32 = 51;
  76. int64 oneof_int64 = 52;
  77. uint32 oneof_uint32 = 53;
  78. uint64 oneof_uint64 = 54;
  79. sint32 oneof_sint32 = 55;
  80. sint64 oneof_sint64 = 56;
  81. fixed32 oneof_fixed32 = 57;
  82. fixed64 oneof_fixed64 = 58;
  83. sfixed32 oneof_sfixed32 = 59;
  84. sfixed64 oneof_sfixed64 = 60;
  85. float oneof_float = 61;
  86. double oneof_double = 62;
  87. bool oneof_bool = 63;
  88. string oneof_string = 64;
  89. bytes oneof_bytes = 65;
  90. // No 'group' in proto3.
  91. Message3 oneof_message = 68;
  92. Enum oneof_enum = 69;
  93. }
  94. // Some token map cases, too many combinations to list them all.
  95. map<int32 , int32 > map_int32_int32 = 70;
  96. map<int64 , int64 > map_int64_int64 = 71;
  97. map<uint32 , uint32 > map_uint32_uint32 = 72;
  98. map<uint64 , uint64 > map_uint64_uint64 = 73;
  99. map<sint32 , sint32 > map_sint32_sint32 = 74;
  100. map<sint64 , sint64 > map_sint64_sint64 = 75;
  101. map<fixed32 , fixed32 > map_fixed32_fixed32 = 76;
  102. map<fixed64 , fixed64 > map_fixed64_fixed64 = 77;
  103. map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 78;
  104. map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 79;
  105. map<int32 , float > map_int32_float = 80;
  106. map<int32 , double > map_int32_double = 81;
  107. map<bool , bool > map_bool_bool = 82;
  108. map<string , string > map_string_string = 83;
  109. map<string , bytes > map_string_bytes = 84;
  110. map<string , Message3> map_string_message = 85;
  111. map<int32 , bytes > map_int32_bytes = 86;
  112. map<int32 , Enum > map_int32_enum = 87;
  113. map<int32 , Message3> map_int32_message = 88;
  114. }
  115. message Message3Optional {
  116. enum Enum {
  117. FOO = 0;
  118. BAR = 1;
  119. BAZ = 2;
  120. EXTRA_3 = 30;
  121. }
  122. optional int32 optional_int32 = 1;
  123. optional int64 optional_int64 = 2;
  124. optional uint32 optional_uint32 = 3;
  125. optional uint64 optional_uint64 = 4;
  126. optional sint32 optional_sint32 = 5;
  127. optional sint64 optional_sint64 = 6;
  128. optional fixed32 optional_fixed32 = 7;
  129. optional fixed64 optional_fixed64 = 8;
  130. optional sfixed32 optional_sfixed32 = 9;
  131. optional sfixed64 optional_sfixed64 = 10;
  132. optional float optional_float = 11;
  133. optional double optional_double = 12;
  134. optional bool optional_bool = 13;
  135. optional string optional_string = 14;
  136. optional bytes optional_bytes = 15;
  137. // No 'group' in proto3.
  138. optional Message3 optional_message = 18;
  139. optional Enum optional_enum = 19;
  140. }