Make all the tests ANSI C compatible.
This commit is contained in:
@@ -7,12 +7,13 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
uint8_t buffer[512] = {};
|
||||
uint8_t buffer[512];
|
||||
|
||||
/* Create a message with one missing field */
|
||||
{
|
||||
MissingField msg = {};
|
||||
MissingField msg = {0};
|
||||
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
|
||||
|
||||
if (!pb_encode(&stream, MissingField_fields, &msg))
|
||||
{
|
||||
printf("Encode failed.\n");
|
||||
@@ -22,7 +23,7 @@ int main()
|
||||
|
||||
/* Test that it decodes properly if we don't require that field */
|
||||
{
|
||||
MissingField msg = {};
|
||||
MissingField msg = {0};
|
||||
pb_istream_t stream = pb_istream_from_buffer(buffer, sizeof(buffer));
|
||||
|
||||
if (!pb_decode(&stream, MissingField_fields, &msg))
|
||||
@@ -34,7 +35,7 @@ int main()
|
||||
|
||||
/* Test that it does *not* decode properly if we require the field */
|
||||
{
|
||||
AllFields msg = {};
|
||||
AllFields msg = {0};
|
||||
pb_istream_t stream = pb_istream_from_buffer(buffer, sizeof(buffer));
|
||||
|
||||
if (pb_decode(&stream, AllFields_fields, &msg))
|
||||
|
||||
Reference in New Issue
Block a user