Fix some errors in pedantic mode for testing.h

This commit is contained in:
2024-06-18 23:57:09 +01:00
parent 4e513dbf01
commit 002b21b649

View File

@@ -18,6 +18,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#define MESSAGE(FILE, COLOUR, NAME, FORMAT, ...) \ #define MESSAGE(FILE, COLOUR, NAME, FORMAT, ...) \
@@ -38,7 +39,7 @@ struct Test
}; };
#define CREATE_TEST(NAME) \ #define CREATE_TEST(NAME) \
(struct Test) \ (const struct Test) \
{ \ { \
.name = #NAME, .src = NAME \ .name = #NAME, .src = NAME \
} }
@@ -73,7 +74,7 @@ static void byte_array_to_string(const byte_t *bytes, size_t size_bytes,
size_t j = 1; size_t j = 1;
for (size_t i = 0; i < size_bytes; ++i) for (size_t i = 0; i < size_bytes; ++i)
{ {
char buffer[7]; char buffer[8];
int k = i == size_bytes - 1 ? 0 : 2; int k = i == size_bytes - 1 ? 0 : 2;
size_t n = 4 + k; size_t n = 4 + k;