PhpImplementationTest.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <?php
  2. require_once('test_base.php');
  3. require_once('test_util.php');
  4. use Foo\TestEnum;
  5. use Foo\TestMessage;
  6. use Foo\TestMessage\Sub;
  7. use Foo\TestPackedMessage;
  8. use Google\Protobuf\Internal\CodedInputStream;
  9. use Google\Protobuf\Internal\FileDescriptorSet;
  10. use Google\Protobuf\Internal\GPBLabel;
  11. use Google\Protobuf\Internal\GPBType;
  12. use Google\Protobuf\Internal\GPBWire;
  13. use Google\Protobuf\Internal\CodedOutputStream;
  14. /**
  15. * Please note, this test is only intended to be run without the protobuf C
  16. * extension.
  17. */
  18. class PhpImplementationTest extends TestBase
  19. {
  20. /**
  21. * Avoid calling setUp, which has void return type (not avalialbe in php7.0).
  22. * @before
  23. */
  24. public function skipTestsForExtension()
  25. {
  26. if (extension_loaded('protobuf')) {
  27. $this->markTestSkipped();
  28. }
  29. }
  30. public function testReadInt32()
  31. {
  32. $value = null;
  33. // Positive number.
  34. $input = new CodedInputStream(hex2bin("01"));
  35. GPBWire::readInt32($input, $value);
  36. $this->assertSame(1, $value);
  37. // Negative number.
  38. $input = new CodedInputStream(hex2bin("ffffffff0f"));
  39. GPBWire::readInt32($input, $value);
  40. $this->assertSame(-1, $value);
  41. // Discard overflow bits.
  42. $input = new CodedInputStream(hex2bin("ffffffff7f"));
  43. GPBWire::readInt32($input, $value);
  44. $this->assertSame(-1, $value);
  45. }
  46. public function testReadUint32()
  47. {
  48. $value = null;
  49. // Positive number.
  50. $input = new CodedInputStream(hex2bin("01"));
  51. GPBWire::readUint32($input, $value);
  52. $this->assertSame(1, $value);
  53. // Max uint32.
  54. $input = new CodedInputStream(hex2bin("ffffffff0f"));
  55. GPBWire::readUint32($input, $value);
  56. $this->assertSame(-1, $value);
  57. // Discard overflow bits.
  58. $input = new CodedInputStream(hex2bin("ffffffff7f"));
  59. GPBWire::readUint32($input, $value);
  60. $this->assertSame(-1, $value);
  61. }
  62. public function testReadInt64()
  63. {
  64. $value = null;
  65. // Positive number.
  66. $input = new CodedInputStream(hex2bin("01"));
  67. GPBWire::readInt64($input, $value);
  68. $this->assertEquals(1, $value);
  69. // Negative number.
  70. $input = new CodedInputStream(hex2bin("ffffffffffffffffff01"));
  71. GPBWire::readInt64($input, $value);
  72. $this->assertEquals(-1, $value);
  73. // Discard overflow bits.
  74. $input = new CodedInputStream(hex2bin("ffffffffffffffffff0f"));
  75. GPBWire::readInt64($input, $value);
  76. $this->assertEquals(-1, $value);
  77. }
  78. public function testReadUint64()
  79. {
  80. $value = null;
  81. // Positive number.
  82. $input = new CodedInputStream(hex2bin("01"));
  83. GPBWire::readUint64($input, $value);
  84. $this->assertEquals(1, $value);
  85. // Negative number.
  86. $input = new CodedInputStream(hex2bin("FFFFFFFFFFFFFFFFFF01"));
  87. GPBWire::readUint64($input, $value);
  88. $this->assertEquals(-1, $value);
  89. // Discard overflow bits.
  90. $input = new CodedInputStream(hex2bin("FFFFFFFFFFFFFFFFFF0F"));
  91. GPBWire::readUint64($input, $value);
  92. $this->assertEquals(-1, $value);
  93. }
  94. public function testReadSint32()
  95. {
  96. $value = null;
  97. $input = new CodedInputStream(hex2bin("00"));
  98. GPBWire::readSint32($input, $value);
  99. $this->assertSame(0, $value);
  100. $input = new CodedInputStream(hex2bin("01"));
  101. GPBWire::readSint32($input, $value);
  102. $this->assertSame(-1, $value);
  103. $input = new CodedInputStream(hex2bin("02"));
  104. GPBWire::readSint32($input, $value);
  105. $this->assertSame(1, $value);
  106. }
  107. public function testReadSint64()
  108. {
  109. $value = null;
  110. $input = new CodedInputStream(hex2bin("00"));
  111. GPBWire::readSint64($input, $value);
  112. $this->assertEquals(0, $value);
  113. $input = new CodedInputStream(hex2bin("01"));
  114. GPBWire::readSint64($input, $value);
  115. $this->assertEquals(-1, $value);
  116. $input = new CodedInputStream(hex2bin("02"));
  117. GPBWire::readSint64($input, $value);
  118. $this->assertEquals(1, $value);
  119. }
  120. public function testReadFixed32()
  121. {
  122. $value = null;
  123. $input = new CodedInputStream(hex2bin("12345678"));
  124. GPBWire::readFixed32($input, $value);
  125. $this->assertSame(0x78563412, $value);
  126. }
  127. public function testReadFixed64()
  128. {
  129. $value = null;
  130. $input = new CodedInputStream(hex2bin("1234567812345678"));
  131. GPBWire::readFixed64($input, $value);
  132. if (PHP_INT_SIZE == 4) {
  133. $this->assertSame("8671175386481439762", $value);
  134. } else {
  135. $this->assertSame(0x7856341278563412, $value);
  136. }
  137. }
  138. public function testReadSfixed32()
  139. {
  140. $value = null;
  141. $input = new CodedInputStream(hex2bin("12345678"));
  142. GPBWire::readSfixed32($input, $value);
  143. $this->assertSame(0x78563412, $value);
  144. }
  145. public function testReadFloat()
  146. {
  147. $value = null;
  148. $input = new CodedInputStream(hex2bin("0000803F"));
  149. GPBWire::readFloat($input, $value);
  150. $this->assertSame(1.0, $value);
  151. }
  152. public function testReadBool()
  153. {
  154. $value = null;
  155. $input = new CodedInputStream(hex2bin("00"));
  156. GPBWire::readBool($input, $value);
  157. $this->assertSame(false, $value);
  158. $input = new CodedInputStream(hex2bin("01"));
  159. GPBWire::readBool($input, $value);
  160. $this->assertSame(true, $value);
  161. }
  162. public function testReadDouble()
  163. {
  164. $value = null;
  165. $input = new CodedInputStream(hex2bin("000000000000F03F"));
  166. GPBWire::readDouble($input, $value);
  167. $this->assertSame(1.0, $value);
  168. }
  169. public function testReadSfixed64()
  170. {
  171. $value = null;
  172. $input = new CodedInputStream(hex2bin("1234567812345678"));
  173. GPBWire::readSfixed64($input, $value);
  174. if (PHP_INT_SIZE == 4) {
  175. $this->assertSame("8671175386481439762", $value);
  176. } else {
  177. $this->assertSame(0x7856341278563412, $value);
  178. }
  179. }
  180. public function testZigZagEncodeDecode()
  181. {
  182. $this->assertSame(0, GPBWire::zigZagEncode32(0));
  183. $this->assertSame(1, GPBWire::zigZagEncode32(-1));
  184. $this->assertSame(2, GPBWire::zigZagEncode32(1));
  185. $this->assertSame(3, GPBWire::zigZagEncode32(-2));
  186. $this->assertSame(0x7FFFFFFE, GPBWire::zigZagEncode32(0x3FFFFFFF));
  187. $this->assertSame(0x7FFFFFFF, GPBWire::zigZagEncode32(0xC0000000));
  188. $this->assertSame(0x7FFFFFFF, GPBWire::zigZagEncode32(-1073741824));
  189. $this->assertSame(0, GPBWire::zigZagDecode32(0));
  190. $this->assertSame(-1, GPBWire::zigZagDecode32(1));
  191. $this->assertSame(1, GPBWire::zigZagDecode32(2));
  192. $this->assertSame(-2, GPBWire::zigZagDecode32(3));
  193. $this->assertSame(0x3FFFFFFF, GPBWire::zigZagDecode32(0x7FFFFFFE));
  194. $this->assertSame(-1073741824, GPBWire::zigZagDecode32(0x7FFFFFFF));
  195. $this->assertSame(0x7FFFFFFF, GPBWire::zigZagDecode32(0xFFFFFFFE));
  196. $this->assertSame((int)-2147483648,GPBWire::zigZagDecode32(0xFFFFFFFF));
  197. if (PHP_INT_SIZE == 4) {
  198. $this->assertSame(-2, GPBWire::zigZagEncode32(0x7FFFFFFF));
  199. $this->assertSame(-1, GPBWire::zigZagEncode32(0x80000000));
  200. $this->assertSame('0', GPBWire::zigZagEncode64(0));
  201. $this->assertSame('1', GPBWire::zigZagEncode64(-1));
  202. $this->assertSame('2', GPBWire::zigZagEncode64(1));
  203. $this->assertSame('3', GPBWire::zigZagEncode64(-2));
  204. $this->assertSame(
  205. '2147483646', // 0x7FFFFFE
  206. GPBWire::zigZagEncode64(0x3FFFFFFF));
  207. $this->assertSame(
  208. '2147483647', // 0x7FFFFFF
  209. GPBWire::zigZagEncode64(-1073741824)); // 0xFFFFFFFFC0000000
  210. $this->assertSame(
  211. '4294967294', // 0xFFFFFFFE
  212. GPBWire::zigZagEncode64(2147483647)); // 0x7FFFFFFF
  213. $this->assertSame(
  214. '4294967295', // 0xFFFFFFFF
  215. GPBWire::zigZagEncode64(-2147483648)); // 0xFFFFFFFF80000000
  216. $this->assertSame(
  217. '18446744073709551614', // 0xFFFFFFFFFFFFFFFE
  218. // 0x7FFFFFFFFFFFFFFF
  219. GPBWire::zigZagEncode64("9223372036854775807"));
  220. $this->assertSame(
  221. '18446744073709551615', // 0xFFFFFFFFFFFFFFFF
  222. // 0x8000000000000000
  223. GPBWire::zigZagEncode64("-9223372036854775808"));
  224. $this->assertSame('0', GPBWire::zigZagDecode64(0));
  225. $this->assertSame('-1', GPBWire::zigZagDecode64(1));
  226. $this->assertSame('1', GPBWire::zigZagDecode64(2));
  227. $this->assertSame('-2', GPBWire::zigZagDecode64(3));
  228. } else {
  229. $this->assertSame(4294967294, GPBWire::zigZagEncode32(0x7FFFFFFF));
  230. $this->assertSame(4294967295, GPBWire::zigZagEncode32(0x80000000));
  231. $this->assertSame(0, GPBWire::zigZagEncode64(0));
  232. $this->assertSame(1, GPBWire::zigZagEncode64(-1));
  233. $this->assertSame(2, GPBWire::zigZagEncode64(1));
  234. $this->assertSame(3, GPBWire::zigZagEncode64(-2));
  235. $this->assertSame(0x7FFFFFFE, GPBWire::zigZagEncode64(0x3FFFFFFF));
  236. $this->assertSame(
  237. 0x7FFFFFFF,
  238. GPBWire::zigZagEncode64(0xFFFFFFFFC0000000));
  239. $this->assertSame(
  240. 0xFFFFFFFE,
  241. GPBWire::zigZagEncode64(0x7FFFFFFF));
  242. $this->assertSame(
  243. 0xFFFFFFFF,
  244. GPBWire::zigZagEncode64(0xFFFFFFFF80000000));
  245. $this->assertSame(
  246. -2, // 0xFFFFFFFFFFFFFFFE
  247. GPBWire::zigZagEncode64(0x7FFFFFFFFFFFFFFF));
  248. $this->assertSame(
  249. -1, // 0xFFFFFFFFFFFFFFFF
  250. GPBWire::zigZagEncode64(0x8000000000000000));
  251. $this->assertSame(0, GPBWire::zigZagDecode64(0));
  252. $this->assertSame(-1, GPBWire::zigZagDecode64(1));
  253. $this->assertSame(1, GPBWire::zigZagDecode64(2));
  254. $this->assertSame(-2, GPBWire::zigZagDecode64(3));
  255. }
  256. // Round trip
  257. $this->assertSame(0, GPBWire::zigZagDecode32(GPBWire::zigZagEncode32(0)));
  258. $this->assertSame(1, GPBWire::zigZagDecode32(GPBWire::zigZagEncode32(1)));
  259. $this->assertSame(-1, GPBWire::zigZagDecode32(GPBWire::zigZagEncode32(-1)));
  260. $this->assertSame(14927,
  261. GPBWire::zigZagDecode32(GPBWire::zigZagEncode32(14927)));
  262. $this->assertSame(-3612,
  263. GPBWire::zigZagDecode32(GPBWire::zigZagEncode32(-3612)));
  264. }
  265. public function testDecode()
  266. {
  267. $m = new TestMessage();
  268. $m->mergeFromString(TestUtil::getGoldenTestMessage());
  269. TestUtil::assertTestMessage($m);
  270. $this->assertTrue(true);
  271. }
  272. public function testDescriptorDecode()
  273. {
  274. $file_desc_set = new FileDescriptorSet();
  275. $file_desc_set->mergeFromString(hex2bin(
  276. "0a3b0a12746573745f696e636c7564652e70726f746f120362617222180a" .
  277. "0b54657374496e636c75646512090a0161180120012805620670726f746f33"));
  278. $this->assertSame(1, sizeof($file_desc_set->getFile()));
  279. $file_desc = $file_desc_set->getFile()[0];
  280. $this->assertSame("test_include.proto", $file_desc->getName());
  281. $this->assertSame("bar", $file_desc->getPackage());
  282. $this->assertSame(0, sizeof($file_desc->getDependency()));
  283. $this->assertSame(1, sizeof($file_desc->getMessageType()));
  284. $this->assertSame(0, sizeof($file_desc->getEnumType()));
  285. $this->assertSame("proto3", $file_desc->getSyntax());
  286. $desc = $file_desc->getMessageType()[0];
  287. $this->assertSame("TestInclude", $desc->getName());
  288. $this->assertSame(1, sizeof($desc->getField()));
  289. $this->assertSame(0, sizeof($desc->getNestedType()));
  290. $this->assertSame(0, sizeof($desc->getEnumType()));
  291. $this->assertSame(0, sizeof($desc->getOneofDecl()));
  292. $field = $desc->getField()[0];
  293. $this->assertSame("a", $field->getName());
  294. $this->assertSame(1, $field->getNumber());
  295. $this->assertSame(GPBLabel::OPTIONAL, $field->getLabel());
  296. $this->assertSame(GPBType::INT32, $field->getType());
  297. }
  298. public function testReadVarint64()
  299. {
  300. $var = 0;
  301. // Empty buffer.
  302. $input = new CodedInputStream(hex2bin(''));
  303. $this->assertFalse($input->readVarint64($var));
  304. // The largest varint is 10 bytes long.
  305. $input = new CodedInputStream(hex2bin('8080808080808080808001'));
  306. $this->assertFalse($input->readVarint64($var));
  307. // Corrupted varint.
  308. $input = new CodedInputStream(hex2bin('808080'));
  309. $this->assertFalse($input->readVarint64($var));
  310. // Normal case.
  311. $input = new CodedInputStream(hex2bin('808001'));
  312. $this->assertTrue($input->readVarint64($var));
  313. if (PHP_INT_SIZE == 4) {
  314. $this->assertSame('16384', $var);
  315. } else {
  316. $this->assertSame(16384, $var);
  317. }
  318. $this->assertFalse($input->readVarint64($var));
  319. // Read two varint.
  320. $input = new CodedInputStream(hex2bin('808001808002'));
  321. $this->assertTrue($input->readVarint64($var));
  322. if (PHP_INT_SIZE == 4) {
  323. $this->assertSame('16384', $var);
  324. } else {
  325. $this->assertSame(16384, $var);
  326. }
  327. $this->assertTrue($input->readVarint64($var));
  328. if (PHP_INT_SIZE == 4) {
  329. $this->assertSame('32768', $var);
  330. } else {
  331. $this->assertSame(32768, $var);
  332. }
  333. $this->assertFalse($input->readVarint64($var));
  334. // Read 64 testing
  335. $testVals = array(
  336. '10' => '0a000000000000000000',
  337. '100' => '64000000000000000000',
  338. '800' => 'a0060000000000000000',
  339. '6400' => '80320000000000000000',
  340. '70400' => '80a60400000000000000',
  341. '774400' => '80a22f00000000000000',
  342. '9292800' => '8098b704000000000000',
  343. '74342400' => '80c0b923000000000000',
  344. '743424000' => '8080bfe2020000000000',
  345. '8177664000' => '8080b5bb1e0000000000',
  346. '65421312000' => '8080a8dbf30100000000',
  347. '785055744000' => '8080e0c7ec1600000000',
  348. '9420668928000' => '808080dd969202000000',
  349. '103627358208000' => '808080fff9c717000000',
  350. '1139900940288000' => '808080f5bd9783020000',
  351. '13678811283456000' => '808080fce699a6180000',
  352. '109430490267648000' => '808080e0b7ceb1c20100',
  353. '984874412408832000' => '808080e0f5c1bed50d00',
  354. );
  355. foreach ($testVals as $original => $encoded) {
  356. $input = new CodedInputStream(hex2bin($encoded));
  357. $this->assertTrue($input->readVarint64($var));
  358. $this->assertEquals($original, $var);
  359. }
  360. }
  361. public function testReadVarint32()
  362. {
  363. $var = 0;
  364. // Empty buffer.
  365. $input = new CodedInputStream(hex2bin(''));
  366. $this->assertFalse($input->readVarint32($var));
  367. // The largest varint is 10 bytes long.
  368. $input = new CodedInputStream(hex2bin('8080808080808080808001'));
  369. $this->assertFalse($input->readVarint32($var));
  370. // Corrupted varint.
  371. $input = new CodedInputStream(hex2bin('808080'));
  372. $this->assertFalse($input->readVarint32($var));
  373. // Normal case.
  374. $input = new CodedInputStream(hex2bin('808001'));
  375. $this->assertTrue($input->readVarint32($var));
  376. $this->assertSame(16384, $var);
  377. $this->assertFalse($input->readVarint32($var));
  378. // Read two varint.
  379. $input = new CodedInputStream(hex2bin('808001808002'));
  380. $this->assertTrue($input->readVarint32($var));
  381. $this->assertSame(16384, $var);
  382. $this->assertTrue($input->readVarint32($var));
  383. $this->assertSame(32768, $var);
  384. $this->assertFalse($input->readVarint32($var));
  385. // Read a 64-bit integer. High-order bits should be discarded.
  386. $input = new CodedInputStream(hex2bin('808081808001'));
  387. $this->assertTrue($input->readVarint32($var));
  388. $this->assertSame(16384, $var);
  389. $this->assertFalse($input->readVarint32($var));
  390. }
  391. public function testReadTag()
  392. {
  393. $input = new CodedInputStream(hex2bin('808001'));
  394. $tag = $input->readTag();
  395. $this->assertSame(16384, $tag);
  396. $tag = $input->readTag();
  397. $this->assertSame(0, $tag);
  398. }
  399. public function testPushPopLimit()
  400. {
  401. $input = new CodedInputStream(hex2bin('808001'));
  402. $old_limit = $input->pushLimit(0);
  403. $tag = $input->readTag();
  404. $this->assertSame(0, $tag);
  405. $input->popLimit($old_limit);
  406. $tag = $input->readTag();
  407. $this->assertSame(16384, $tag);
  408. }
  409. public function testReadRaw()
  410. {
  411. $input = new CodedInputStream(hex2bin('808001'));
  412. $buffer = null;
  413. $this->assertTrue($input->readRaw(3, $buffer));
  414. $this->assertSame(hex2bin('808001'), $buffer);
  415. $this->assertFalse($input->readRaw(1, $buffer));
  416. }
  417. public function testWriteVarint32()
  418. {
  419. $output = new CodedOutputStream(3);
  420. $output->writeVarint32(16384, true);
  421. $this->assertSame(hex2bin('808001'), $output->getData());
  422. // Negative numbers are padded to be compatible with int64.
  423. $output = new CodedOutputStream(10);
  424. $output->writeVarint32(-43, false);
  425. $this->assertSame(hex2bin('D5FFFFFFFFFFFFFFFF01'), $output->getData());
  426. }
  427. public function testWriteVarint64()
  428. {
  429. $output = new CodedOutputStream(10);
  430. $output->writeVarint64(-43);
  431. $this->assertSame(hex2bin('D5FFFFFFFFFFFFFFFF01'), $output->getData());
  432. }
  433. public function testWriteLittleEndian32()
  434. {
  435. $output = new CodedOutputStream(4);
  436. $output->writeLittleEndian32(46);
  437. $this->assertSame(hex2bin('2E000000'), $output->getData());
  438. }
  439. public function testWriteLittleEndian64()
  440. {
  441. $output = new CodedOutputStream(8);
  442. $output->writeLittleEndian64(47);
  443. $this->assertSame(hex2bin('2F00000000000000'), $output->getData());
  444. }
  445. public function testByteSize()
  446. {
  447. $m = new TestMessage();
  448. TestUtil::setTestMessage($m);
  449. $this->assertSame(504, $m->byteSize());
  450. }
  451. public function testPackedByteSize()
  452. {
  453. $m = new TestPackedMessage();
  454. TestUtil::setTestPackedMessage($m);
  455. $this->assertSame(166, $m->byteSize());
  456. }
  457. public function testArrayConstructorJsonCaseThrowsException()
  458. {
  459. $this->expectException(UnexpectedValueException::class);
  460. $this->expectExceptionMessage(
  461. 'Invalid message property: optionalInt32');
  462. $m = new TestMessage([
  463. 'optionalInt32' => -42,
  464. ]);
  465. }
  466. public function testArraysForMessagesThrowsException()
  467. {
  468. $this->expectException(Exception::class);
  469. $this->expectExceptionMessage(
  470. 'Expect Foo\TestMessage\Sub.');
  471. $m = new TestMessage([
  472. 'optional_message' => [
  473. 'a' => 33
  474. ]
  475. ]);
  476. }
  477. public function testArrayConstructorWithNullValues()
  478. {
  479. $requestData = [
  480. 'optional_bool' => null,
  481. 'optional_string' => null,
  482. 'optional_bytes' => null,
  483. 'optional_message' => null,
  484. ];
  485. $m = new TestMessage($requestData);
  486. $this->assertSame(false, $m->getOptionalBool());
  487. $this->assertSame('', $m->getOptionalString());
  488. $this->assertSame('', $m->getOptionalBytes());
  489. $this->assertSame(null, $m->getOptionalMessage());
  490. }
  491. /**
  492. * @dataProvider provideArrayConstructorWithNullValuesThrowsException
  493. */
  494. public function testArrayConstructorWithNullValuesThrowsException($requestData)
  495. {
  496. $this->expectException(Exception::class);
  497. $m = new TestMessage($requestData);
  498. }
  499. public function provideArrayConstructorWithNullValuesThrowsException()
  500. {
  501. return [
  502. [['optional_int32' => null]],
  503. [['optional_int64' => null]],
  504. [['optional_uint32' => null]],
  505. [['optional_uint64' => null]],
  506. [['optional_sint32' => null]],
  507. [['optional_sint64' => null]],
  508. [['optional_fixed32' => null]],
  509. [['optional_fixed64' => null]],
  510. [['optional_sfixed32' => null]],
  511. [['optional_sfixed64' => null]],
  512. [['optional_float' => null]],
  513. [['optional_double' => null]],
  514. [['optional_enum' => null]],
  515. [['repeated_int32' => null]],
  516. [['map_int32_int32' => null]],
  517. ];
  518. }
  519. }