summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/alltypes/decode_alltypes.c3
-rw-r--r--tests/alltypes/encode_alltypes.c2
-rw-r--r--tests/basic_buffer/decode_buffer.c2
-rw-r--r--tests/basic_stream/decode_stream.c2
4 files changed, 5 insertions, 4 deletions
diff --git a/tests/alltypes/decode_alltypes.c b/tests/alltypes/decode_alltypes.c
index 0202ebc1..67cb72c4 100644
--- a/tests/alltypes/decode_alltypes.c
+++ b/tests/alltypes/decode_alltypes.c
@@ -19,7 +19,8 @@
the decoding and checks the fields. */
bool check_alltypes(pb_istream_t *stream, int mode)
{
- AllTypes alltypes;
+ /* Uses _init_default to just make sure that it works. */
+ AllTypes alltypes = AllTypes_init_default;
/* Fill with garbage to better detect initialization errors */
memset(&alltypes, 0xAA, sizeof(alltypes));
diff --git a/tests/alltypes/encode_alltypes.c b/tests/alltypes/encode_alltypes.c
index fa8eec94..deec7903 100644
--- a/tests/alltypes/encode_alltypes.c
+++ b/tests/alltypes/encode_alltypes.c
@@ -13,7 +13,7 @@ int main(int argc, char **argv)
int mode = (argc > 1) ? atoi(argv[1]) : 0;
/* Initialize the structure with constants */
- AllTypes alltypes = {0};
+ AllTypes alltypes = AllTypes_init_zero;
alltypes.req_int32 = -1001;
alltypes.req_int64 = -1002;
diff --git a/tests/basic_buffer/decode_buffer.c b/tests/basic_buffer/decode_buffer.c
index fae9e2fa..291d164c 100644
--- a/tests/basic_buffer/decode_buffer.c
+++ b/tests/basic_buffer/decode_buffer.c
@@ -16,7 +16,7 @@
bool print_person(pb_istream_t *stream)
{
int i;
- Person person;
+ Person person = Person_init_zero;
if (!pb_decode(stream, Person_fields, &person))
return false;
diff --git a/tests/basic_stream/decode_stream.c b/tests/basic_stream/decode_stream.c
index 667bf3c5..798dcc50 100644
--- a/tests/basic_stream/decode_stream.c
+++ b/tests/basic_stream/decode_stream.c
@@ -12,7 +12,7 @@
bool print_person(pb_istream_t *stream)
{
int i;
- Person person;
+ Person person = Person_init_zero;
if (!pb_decode(stream, Person_fields, &person))
return false;