1 /* Attempts to test all the datatypes supported by ProtoBuf.
2 * Currently only tests the 'required' variety.
7 #include "alltypes.pb.h"
11 /* Initialize the structure with constants */
38 pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
40 /* Now encode it and check if we succeeded. */
41 if (pb_encode(&stream, AllTypes_fields, &alltypes))
43 fwrite(buffer, 1, stream.bytes_written, stdout);
44 return 0; /* Success */
48 return 1; /* Failure */