1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 20:25:28 +03:00
aports/testing/detox/tests.patch
2025-06-13 13:53:00 +00:00

57 lines
1.7 KiB
Diff

test_table_resize.template:118:21: error: format not a string literal and no format arguments [-Werror=format-security]
118 | ck_assert_msg(check != NULL, message);
| ^~~~~~~~~~~~~
--- a/tests/unit/test_table_resize.c
+++ b/tests/unit/test_table_resize.c
@@ -61,7 +61,6 @@
static char *table_filename = "fixtures/test_table_resize.tbl";
#define HEADER_LEN 256
-#define MESSAGE_LEN 1024
START_TEST(test_table_resize)
{
@@ -70,13 +69,11 @@
table_t *new_table;
char *check;
char *header;
- char *message;
int i, j;
int size;
int use_hash;
header = malloc(HEADER_LEN);
- message = malloc(MESSAGE_LEN);
for (use_hash = 0; use_hash <= 1; use_hash++) {
table = parse_table(table_filename);
@@ -115,22 +112,17 @@
#ifdef DEBUG
printf("\t0x%04x -> \"%s\"\n", values[j].value, check);
#endif
- snprintf(
- message,
- MESSAGE_LEN,
+
+ ck_assert_msg(
+ values[j].expected != NULL ?
+ check != NULL && strcmp(check, values[j].expected) == 0 :
+ check == NULL,
"%s, value = 0x%04X, expected = %s, output = %s",
header,
values[j].value,
values[j].expected,
check
);
-
- if (values[j].expected != NULL) {
- ck_assert_msg(check != NULL, message);
- ck_assert_msg(strcmp(check, values[j].expected) == 0, message);
- } else {
- ck_assert_msg(check == NULL, message);
- }
}
}