X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Fbasic_stream%2Fencode_stream.c;h=7f571c4127d850f31faf0807b77611e9285faf8b;hb=61ad04afd5236e2a6a0d4b4f2caa3bab4a820c99;hp=fd25c6cbabac49e4e5400667c854e162b029b72c;hpb=262c62676cf740ec3ce14a22bde47b7968fec8f0;p=apps%2Fagl-service-can-low-level.git diff --git a/tests/basic_stream/encode_stream.c b/tests/basic_stream/encode_stream.c index fd25c6cb..7f571c41 100644 --- a/tests/basic_stream/encode_stream.c +++ b/tests/basic_stream/encode_stream.c @@ -4,6 +4,7 @@ #include #include #include "person.pb.h" +#include "test_helpers.h" /* This binds the pb_ostream_t into the stdout stream */ bool streamcallback(pb_ostream_t *stream, const uint8_t *buf, size_t count) @@ -22,7 +23,9 @@ int main() }}; /* Prepare the stream, output goes directly to stdout */ - pb_ostream_t stream = {&streamcallback, stdout, SIZE_MAX, 0}; + pb_ostream_t stream = {&streamcallback, NULL, SIZE_MAX, 0}; + stream.state = stdout; + SET_BINARY_MODE(stdout); /* Now encode it and check if we succeeded. */ if (pb_encode(&stream, Person_fields, &person))