Skip to content

Commit

Permalink
Avoid stack overflow in alltypes_proto3 testcase on AVR
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriAimonen committed Feb 1, 2020
1 parent 515372a commit e5c104a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/alltypes_proto3/decode_alltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
#include <pb_decode.h>
#include "alltypes.pb.h"
#include "test_helpers.h"

#define TEST(x) if (!(x)) { \
printf("Test " #x " failed.\n"); \
return false; \
}
#include "unittests.h"

/* This function is called once from main(), it handles
the decoding and checks the fields. */
bool check_alltypes(pb_istream_t *stream, int mode)
{
int status = 0;
AllTypes alltypes = AllTypes_init_zero;

/* Fill with garbage to better detect initialization errors */
Expand Down Expand Up @@ -139,7 +136,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)

TEST(alltypes.end == 1099);

return true;
return status == 0;
}

int main(int argc, char **argv)
Expand Down

0 comments on commit e5c104a

Please sign in to comment.