Reduce string sizes in tests for AVR
diff --git a/tests/alltypes_callback/decode_alltypes_callback.c b/tests/alltypes_callback/decode_alltypes_callback.c
index e452c38..8079a04 100644
--- a/tests/alltypes_callback/decode_alltypes_callback.c
+++ b/tests/alltypes_callback/decode_alltypes_callback.c
@@ -11,7 +11,7 @@
#include "test_helpers.h"
#define TEST(x) if (!(x)) { \
- printf("Test " #x " failed (in field %d).\n", field->tag); \
+ printf("Test %s failed (in field %d).\n", #x, field->tag); \
return false; \
}
diff --git a/tests/alltypes_pointer/decode_alltypes_pointer.c b/tests/alltypes_pointer/decode_alltypes_pointer.c
index d2492e2..5659012 100644
--- a/tests/alltypes_pointer/decode_alltypes_pointer.c
+++ b/tests/alltypes_pointer/decode_alltypes_pointer.c
@@ -4,17 +4,13 @@
#include <pb_decode.h>
#include "alltypes.pb.h"
#include "test_helpers.h"
-
-#define TEST(x) if (!(x)) { \
- fprintf(stderr, "Test " #x " failed.\n"); \
- status = 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)
{
- bool status = true;
+ int status = 0;
AllTypes alltypes;
/* Fill with garbage to better detect initialization errors */
@@ -168,7 +164,7 @@
pb_release(AllTypes_fields, &alltypes);
- return status;
+ return status == 0;
}
int main(int argc, char **argv)
diff --git a/tests/alltypes_proto3_callback/decode_alltypes_callback.c b/tests/alltypes_proto3_callback/decode_alltypes_callback.c
index ffa40aa..be0caa5 100644
--- a/tests/alltypes_proto3_callback/decode_alltypes_callback.c
+++ b/tests/alltypes_proto3_callback/decode_alltypes_callback.c
@@ -11,7 +11,7 @@
#include "test_helpers.h"
#define TEST(x) if (!(x)) { \
- printf("Test " #x " failed (in field %d).\n", field->tag); \
+ printf("Test %s failed (in field %d).\n", #x, field->tag); \
return false; \
}
diff --git a/tests/mem_release/mem_release.c b/tests/mem_release/mem_release.c
index 6e06da5..69d5f03 100644
--- a/tests/mem_release/mem_release.c
+++ b/tests/mem_release/mem_release.c
@@ -8,7 +8,7 @@
#include "mem_release.pb.h"
#define TEST(x) if (!(x)) { \
- fprintf(stderr, "Test " #x " on line %d failed.\n", __LINE__); \
+ fprintf(stderr, "Test %s on line %d failed.\n", #x, __LINE__); \
return false; \
}