summaryrefslogtreecommitdiffstats
path: root/tests/basic_stream/decode_stream.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-11 13:16:20 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-11 13:16:20 +0300
commitb9f14bddf778a5ed27e3289b90a0657fec3e1a53 (patch)
tree972d67e547f1816d3dbe0643ea8add734ef8e90e /tests/basic_stream/decode_stream.c
parente2e9980627810fe0ee2b8f119bcf651f0f318a8a (diff)
Make all the tests ANSI C compatible.
Diffstat (limited to 'tests/basic_stream/decode_stream.c')
-rw-r--r--tests/basic_stream/decode_stream.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/basic_stream/decode_stream.c b/tests/basic_stream/decode_stream.c
index 2142977e..667bf3c5 100644
--- a/tests/basic_stream/decode_stream.c
+++ b/tests/basic_stream/decode_stream.c
@@ -4,6 +4,7 @@
#include <stdio.h>
#include <pb_decode.h>
#include "person.pb.h"
+#include "test_helpers.h"
/* This function is called once from main(), it handles
the decoding and printing.
@@ -69,10 +70,10 @@ bool callback(pb_istream_t *stream, uint8_t *buf, size_t count)
int main()
{
- /* Maximum size is specified to prevent infinite length messages from
- * hanging this in the fuzz test.
- */
- pb_istream_t stream = {&callback, stdin, 10000};
+ pb_istream_t stream = {&callback, NULL, SIZE_MAX};
+ stream.state = stdin;
+ SET_BINARY_MODE(stdin);
+
if (!print_person(&stream))
{
printf("Parsing failed: %s\n", PB_GET_ERROR(&stream));