+#define NANOPB_INTERNALS
+
#include <stdio.h>
#include <string.h>
#include "pb_decode.h"
}
/* Verifies that the stream passed to callback matches the byte array pointed to by arg. */
-bool callback_check(pb_istream_t *stream, const pb_field_t *field, void *arg)
+bool callback_check(pb_istream_t *stream, const pb_field_t *field, void **arg)
{
int i;
uint8_t byte;
- pb_bytes_array_t *ref = (pb_bytes_array_t*) arg;
+ pb_bytes_array_t *ref = (pb_bytes_array_t*) *arg;
for (i = 0; i < ref->size; i++)
{
TEST((s = S("\x08"), !pb_decode(&s, IntegerArray_fields, &dest)))
}
+ {
+ pb_istream_t s;
+ IntegerContainer dest = {};
+
+ COMMENT("Testing pb_decode_delimited")
+ TEST((s = S("\x09\x0A\x07\x0A\x05\x01\x02\x03\x04\x05"),
+ pb_decode_delimited(&s, IntegerContainer_fields, &dest)) &&
+ dest.submsg.data_count == 5)
+ }
+
if (status != 0)
fprintf(stdout, "\n\nSome tests FAILED!\n");