simpletest.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. syntax = "proto3";
  2. import "externalpackagetest.proto";
  3. package qtprotobufnamespace.tests;
  4. message EmptyMessage {
  5. }
  6. message SimpleEnumMessage {
  7. enum LocalEnum {
  8. LOCAL_ENUM_VALUE0 = 0;
  9. LOCAL_ENUM_VALUE1 = 1;
  10. LOCAL_ENUM_VALUE2 = 2;
  11. LOCAL_ENUM_VALUE3 = 3;
  12. }
  13. LocalEnum localEnum = 1;
  14. }
  15. message SimpleEnumListMessage {
  16. enum LocalEnum {
  17. LOCAL_ENUM_VALUE0 = 0;
  18. LOCAL_ENUM_VALUE1 = 1;
  19. LOCAL_ENUM_VALUE2 = 2;
  20. LOCAL_ENUM_VALUE3 = 3;
  21. }
  22. repeated LocalEnum localEnumList = 1;
  23. }
  24. message SimpleFileEnumMessage {
  25. TestEnum globalEnum = 1;
  26. repeated TestEnum globalEnumList = 2;
  27. }
  28. message StepChildEnumMessage {
  29. SimpleEnumMessage.LocalEnum localStepChildEnum = 1;
  30. repeated SimpleEnumMessage.LocalEnum localStepChildList = 2;
  31. }
  32. message SimpleExternalEnumMessage {
  33. qtprotobufnamespace1.externaltests.ExternalTestEnum externalEnum = 1;
  34. }
  35. message SimpleBoolMessage {
  36. bool testFieldBool = 1;
  37. }
  38. message SimpleIntMessage {
  39. int32 testFieldInt = 1;
  40. }
  41. message SimpleSIntMessage {
  42. sint32 testFieldInt = 1;
  43. }
  44. message SimpleUIntMessage {
  45. uint32 testFieldInt = 1;
  46. }
  47. message SimpleInt64Message {
  48. int64 testFieldInt = 1;
  49. }
  50. message SimpleSInt64Message {
  51. sint64 testFieldInt = 1;
  52. }
  53. message SimpleUInt64Message {
  54. uint64 testFieldInt = 1;
  55. }
  56. message SimpleStringMessage {
  57. string testFieldString = 6;
  58. }
  59. message SimpleFloatMessage {
  60. float testFieldFloat = 7;
  61. }
  62. message SimpleDoubleMessage {
  63. double testFieldDouble = 8;
  64. }
  65. message SimpleBytesMessage {
  66. bytes testFieldBytes = 1;
  67. }
  68. message SimpleFixedInt32Message {
  69. fixed32 testFieldFixedInt32 = 1;
  70. }
  71. message SimpleFixedInt64Message {
  72. fixed64 testFieldFixedInt64 = 1;
  73. }
  74. message SimpleSFixedInt32Message {
  75. sfixed32 testFieldFixedInt32 = 1;
  76. }
  77. message SimpleSFixedInt64Message {
  78. sfixed64 testFieldFixedInt64 = 1;
  79. }
  80. message ComplexMessage {
  81. int32 testFieldInt = 1;
  82. SimpleStringMessage testComplexField = 2;
  83. }
  84. message RepeatedStringMessage {
  85. repeated string testRepeatedString = 1;
  86. }
  87. message RepeatedDoubleMessage {
  88. repeated double testRepeatedDouble = 1;
  89. }
  90. message RepeatedBytesMessage {
  91. repeated bytes testRepeatedBytes = 1;
  92. }
  93. message RepeatedFloatMessage {
  94. repeated float testRepeatedFloat = 1;
  95. }
  96. message RepeatedComplexMessage {
  97. repeated ComplexMessage testRepeatedComplex = 1;
  98. }
  99. message RepeatedExternalComplexMessage {
  100. repeated qtprotobufnamespace1.externaltests.ExternalComplexMessage testExternalComplex = 1;
  101. }
  102. message RepeatedSIntMessage {
  103. repeated sint32 testRepeatedInt = 1;
  104. }
  105. message RepeatedIntMessage {
  106. repeated int32 testRepeatedInt = 1;
  107. }
  108. message RepeatedUIntMessage {
  109. repeated uint32 testRepeatedInt = 1;
  110. }
  111. message RepeatedSInt64Message {
  112. repeated sint64 testRepeatedInt = 1;
  113. }
  114. message RepeatedInt64Message {
  115. repeated int64 testRepeatedInt = 1;
  116. }
  117. message RepeatedUInt64Message {
  118. repeated uint64 testRepeatedInt = 1;
  119. }
  120. message RepeatedFixedIntMessage {
  121. repeated fixed32 testRepeatedInt = 1;
  122. }
  123. message RepeatedSFixedIntMessage {
  124. repeated sfixed32 testRepeatedInt = 1;
  125. }
  126. message RepeatedFixedInt64Message {
  127. repeated fixed64 testRepeatedInt = 1;
  128. }
  129. message RepeatedSFixedInt64Message {
  130. repeated sfixed64 testRepeatedInt = 1;
  131. }
  132. //MAPS
  133. //Types to String
  134. message SimpleSInt32StringMapMessage {
  135. map<sint32, string> mapField = 1;
  136. }
  137. message SimpleSInt64StringMapMessage {
  138. map<sint64, string> mapField = 2;
  139. }
  140. message SimpleInt32StringMapMessage {
  141. map<int32, string> mapField = 3;
  142. }
  143. message SimpleInt64StringMapMessage {
  144. map<int64, string> mapField = 4;
  145. }
  146. message SimpleUInt32StringMapMessage {
  147. map<uint32, string> mapField = 5;
  148. }
  149. message SimpleUInt64StringMapMessage {
  150. map<uint64, string> mapField = 6;
  151. }
  152. message SimpleFixed32StringMapMessage {
  153. map<fixed32, string> mapField = 7;
  154. }
  155. message SimpleFixed64StringMapMessage {
  156. map<fixed64, string> mapField = 8;
  157. }
  158. message SimpleSFixed32StringMapMessage {
  159. map<sfixed32, string> mapField = 9;
  160. }
  161. message SimpleSFixed64StringMapMessage {
  162. map<sfixed64, string> mapField = 10;
  163. }
  164. message SimpleStringStringMapMessage {
  165. map<string, string> mapField = 13;
  166. }
  167. //Types to sint32
  168. message SimpleSInt32SInt32MapMessage {
  169. map<sint32, sint32> mapField = 1;
  170. }
  171. message SimpleSInt64SInt32MapMessage {
  172. map<sint64, sint32> mapField = 2;
  173. }
  174. message SimpleInt32SInt32MapMessage {
  175. map<int32, sint32> mapField = 3;
  176. }
  177. message SimpleInt64SInt32MapMessage {
  178. map<int64, sint32> mapField = 4;
  179. }
  180. message SimpleUInt32SInt32MapMessage {
  181. map<uint32, sint32> mapField = 5;
  182. }
  183. message SimpleUInt64SInt32MapMessage {
  184. map<uint64, sint32> mapField = 6;
  185. }
  186. message SimpleFixed32SInt32MapMessage {
  187. map<fixed32, sint32> mapField = 7;
  188. }
  189. message SimpleFixed64SInt32MapMessage {
  190. map<fixed64, sint32> mapField = 8;
  191. }
  192. message SimpleSFixed32SInt32MapMessage {
  193. map<sfixed32, sint32> mapField = 9;
  194. }
  195. message SimpleSFixed64SInt32MapMessage {
  196. map<sfixed64, sint32> mapField = 10;
  197. }
  198. message SimpleStringSInt32MapMessage {
  199. map<string, sint32> mapField = 13;
  200. }
  201. //Types to sint64
  202. message SimpleSInt32SInt64MapMessage {
  203. map<sint32, sint64> mapField = 1;
  204. }
  205. message SimpleSInt64SInt64MapMessage {
  206. map<sint64, sint64> mapField = 2;
  207. }
  208. message SimpleInt32SInt64MapMessage {
  209. map<int32, sint64> mapField = 3;
  210. }
  211. message SimpleInt64SInt64MapMessage {
  212. map<int64, sint64> mapField = 4;
  213. }
  214. message SimpleUInt32SInt64MapMessage {
  215. map<uint32, sint64> mapField = 5;
  216. }
  217. message SimpleUInt64SInt64MapMessage {
  218. map<uint64, sint64> mapField = 6;
  219. }
  220. message SimpleFixed32SInt64MapMessage {
  221. map<fixed32, sint64> mapField = 7;
  222. }
  223. message SimpleFixed64SInt64MapMessage {
  224. map<fixed64, sint64> mapField = 8;
  225. }
  226. message SimpleSFixed32SInt64MapMessage {
  227. map<sfixed32, sint64> mapField = 9;
  228. }
  229. message SimpleSFixed64SInt64MapMessage {
  230. map<sfixed64, sint64> mapField = 10;
  231. }
  232. message SimpleStringSInt64MapMessage {
  233. map<string, sint64> mapField = 13;
  234. }
  235. //Types to uint32
  236. message SimpleSInt32UInt32MapMessage {
  237. map<sint32, uint32> mapField = 1;
  238. }
  239. message SimpleSInt64UInt32MapMessage {
  240. map<sint64, uint32> mapField = 2;
  241. }
  242. message SimpleInt32UInt32MapMessage {
  243. map<int32, uint32> mapField = 3;
  244. }
  245. message SimpleInt64UInt32MapMessage {
  246. map<int64, uint32> mapField = 4;
  247. }
  248. message SimpleUInt32UInt32MapMessage {
  249. map<uint32, uint32> mapField = 5;
  250. }
  251. message SimpleUInt64UInt32MapMessage {
  252. map<uint64, uint32> mapField = 6;
  253. }
  254. message SimpleFixed32UInt32MapMessage {
  255. map<fixed32, uint32> mapField = 7;
  256. }
  257. message SimpleFixed64UInt32MapMessage {
  258. map<fixed64, uint32> mapField = 8;
  259. }
  260. message SimpleSFixed32UInt32MapMessage {
  261. map<sfixed32, uint32> mapField = 9;
  262. }
  263. message SimpleSFixed64UInt32MapMessage {
  264. map<sfixed64, uint32> mapField = 10;
  265. }
  266. message SimpleStringUInt32MapMessage {
  267. map<string, uint32> mapField = 13;
  268. }
  269. //Types to uint64
  270. message SimpleSInt32UInt64MapMessage {
  271. map<sint32, uint64> mapField = 1;
  272. }
  273. message SimpleSInt64UInt64MapMessage {
  274. map<sint64, uint64> mapField = 2;
  275. }
  276. message SimpleInt32UInt64MapMessage {
  277. map<int32, uint64> mapField = 3;
  278. }
  279. message SimpleInt64UInt64MapMessage {
  280. map<int64, uint64> mapField = 4;
  281. }
  282. message SimpleUInt32UInt64MapMessage {
  283. map<uint32, uint64> mapField = 5;
  284. }
  285. message SimpleUInt64UInt64MapMessage {
  286. map<uint64, uint64> mapField = 6;
  287. }
  288. message SimpleFixed32UInt64MapMessage {
  289. map<fixed32, uint64> mapField = 7;
  290. }
  291. message SimpleFixed64UInt64MapMessage {
  292. map<fixed64, uint64> mapField = 8;
  293. }
  294. message SimpleSFixed32UInt64MapMessage {
  295. map<sfixed32, uint64> mapField = 9;
  296. }
  297. message SimpleSFixed64UInt64MapMessage {
  298. map<sfixed64, uint64> mapField = 10;
  299. }
  300. message SimpleStringUInt64MapMessage {
  301. map<string, uint64> mapField = 13;
  302. }
  303. //Types to int32
  304. message SimpleSInt32Int32MapMessage {
  305. map<sint32, int32> mapField = 1;
  306. }
  307. message SimpleSInt64Int32MapMessage {
  308. map<sint64, int32> mapField = 2;
  309. }
  310. message SimpleInt32Int32MapMessage {
  311. map<int32, int32> mapField = 3;
  312. }
  313. message SimpleInt64Int32MapMessage {
  314. map<int64, int32> mapField = 4;
  315. }
  316. message SimpleUInt32Int32MapMessage {
  317. map<uint32, int32> mapField = 5;
  318. }
  319. message SimpleUInt64Int32MapMessage {
  320. map<uint64, int32> mapField = 6;
  321. }
  322. message SimpleFixed32Int32MapMessage {
  323. map<fixed32, int32> mapField = 7;
  324. }
  325. message SimpleFixed64Int32MapMessage {
  326. map<fixed64, int32> mapField = 8;
  327. }
  328. message SimpleSFixed32Int32MapMessage {
  329. map<sfixed32, int32> mapField = 9;
  330. }
  331. message SimpleSFixed64Int32MapMessage {
  332. map<sfixed64, int32> mapField = 10;
  333. }
  334. message SimpleStringInt32MapMessage {
  335. map<string, int32> mapField = 13;
  336. }
  337. //Types to int64
  338. message SimpleSInt32Int64MapMessage {
  339. map<sint32, int64> mapField = 1;
  340. }
  341. message SimpleSInt64Int64MapMessage {
  342. map<sint64, int64> mapField = 2;
  343. }
  344. message SimpleInt32Int64MapMessage {
  345. map<int32, int64> mapField = 3;
  346. }
  347. message SimpleInt64Int64MapMessage {
  348. map<int64, int64> mapField = 4;
  349. }
  350. message SimpleUInt32Int64MapMessage {
  351. map<uint32, int64> mapField = 5;
  352. }
  353. message SimpleUInt64Int64MapMessage {
  354. map<uint64, int64> mapField = 6;
  355. }
  356. message SimpleFixed32Int64MapMessage {
  357. map<fixed32, int64> mapField = 7;
  358. }
  359. message SimpleFixed64Int64MapMessage {
  360. map<fixed64, int64> mapField = 8;
  361. }
  362. message SimpleSFixed32Int64MapMessage {
  363. map<sfixed32, int64> mapField = 9;
  364. }
  365. message SimpleSFixed64Int64MapMessage {
  366. map<sfixed64, int64> mapField = 10;
  367. }
  368. message SimpleStringInt64MapMessage {
  369. map<string, int64> mapField = 13;
  370. }
  371. //Types to ComplexMessage
  372. message SimpleSInt32ComplexMessageMapMessage {
  373. map<sint32, ComplexMessage> mapField = 1;
  374. }
  375. message SimpleSInt64ComplexMessageMapMessage {
  376. map<sint64, ComplexMessage> mapField = 2;
  377. }
  378. message SimpleInt32ComplexMessageMapMessage {
  379. map<int32, ComplexMessage> mapField = 3;
  380. }
  381. message SimpleInt64ComplexMessageMapMessage {
  382. map<int64, ComplexMessage> mapField = 4;
  383. }
  384. message SimpleUInt32ComplexMessageMapMessage {
  385. map<uint32, ComplexMessage> mapField = 5;
  386. }
  387. message SimpleUInt64ComplexMessageMapMessage {
  388. map<uint64, ComplexMessage> mapField = 6;
  389. }
  390. message SimpleFixed32ComplexMessageMapMessage {
  391. map<fixed32, ComplexMessage> mapField = 7;
  392. }
  393. message SimpleFixed64ComplexMessageMapMessage {
  394. map<fixed64, ComplexMessage> mapField = 8;
  395. }
  396. message SimpleSFixed32ComplexMessageMapMessage {
  397. map<sfixed32, ComplexMessage> mapField = 9;
  398. }
  399. message SimpleSFixed64ComplexMessageMapMessage {
  400. map<sfixed64, ComplexMessage> mapField = 10;
  401. }
  402. message SimpleStringComplexMessageMapMessage {
  403. map<string, ComplexMessage> mapField = 13;
  404. }
  405. enum TestEnum {
  406. TEST_ENUM_VALUE0 = 0;
  407. TEST_ENUM_VALUE1 = 1;
  408. TEST_ENUM_VALUE2 = 2;
  409. TEST_ENUM_VALUE3 = 4;
  410. TEST_ENUM_VALUE4 = 3;
  411. }
  412. enum TestEnumSecondInFile {
  413. TEST_ENUM_SIF_VALUE0 = 0;
  414. TEST_ENUM_SIF_VALUE1 = 1;
  415. TEST_ENUM_SIF_VALUE2 = 2;
  416. }
  417. message FieldIndexTest1Message {
  418. sint32 testField = 31;
  419. }
  420. message FieldIndexTest2Message {
  421. sint32 testField = 8191;
  422. }
  423. message FieldIndexTest3Message {
  424. sint32 testField = 2097151;
  425. }
  426. message FieldIndexTest4Message {
  427. sint32 testField = 536870911;
  428. }
  429. message Message_Uderscore_name {
  430. sint32 testField = 1;
  431. }
  432. message MessageUderscorename {
  433. sint32 testField = 1;
  434. }
  435. message MessageUnderscoreField {
  436. sint32 underScore_Message_field = 1;
  437. }
  438. message PriorMessageUnderscoreField {
  439. sint32 _underScoreMessageField = 1;
  440. }
  441. message FollowingMessageUnderscoreField {
  442. sint32 underScoreMessageField_ = 1;
  443. }
  444. message CombinedMessageUnderscoreField {
  445. sint32 _underScoreMessage_Field_ = 1;
  446. }
  447. message MessageUpperCase {
  448. sint32 TestField = 1;
  449. }
  450. message MessageReserved {
  451. sint32 import = 1;
  452. sint32 property = 2;
  453. sint32 id = 3;
  454. }
  455. message MessageUpperCaseReserved {
  456. sint32 Import = 1;
  457. sint32 Property = 2;
  458. sint32 Id = 3;
  459. }
  460. message MessageEnumReserved {
  461. enum ReservedEnum {
  462. Import = 0;
  463. Property = 1;
  464. Id = 2;
  465. }
  466. enum LowerCaseEnum {
  467. enumValue0 = 0;
  468. enumValue1 = 1;
  469. enumValue2 = 2;
  470. }
  471. enum UnderScoreEnum {
  472. _enumUnderscoreValue0 = 0;
  473. _EnumUnderscoreValue1 = 1;
  474. }
  475. }
  476. message lowerCaseMessageName {
  477. sint32 testField = 1;
  478. }
  479. message LowerCaseFieldMessageName {
  480. lowerCaseMessageName testField = 1;
  481. }