simpletest.proto 12 KB

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