| 1 |
|
| 2 | test_table_resize.template:118:21: error: format not a string literal and no format arguments [-Werror=format-security]
|
| 3 | 118 | ck_assert_msg(check != NULL, message);
|
| 4 | | ^~~~~~~~~~~~~
|
| 5 |
|
| 6 | |
| 7 | |
| 8 | @@ -61,7 +61,6 @@
|
| 9 | static char *table_filename = "fixtures/test_table_resize.tbl";
|
| 10 |
|
| 11 | #define HEADER_LEN 256
|
| 12 | -#define MESSAGE_LEN 1024
|
| 13 |
|
| 14 | START_TEST(test_table_resize)
|
| 15 | {
|
| 16 | @@ -70,13 +69,11 @@
|
| 17 | table_t *new_table;
|
| 18 | char *check;
|
| 19 | char *header;
|
| 20 | - char *message;
|
| 21 | int i, j;
|
| 22 | int size;
|
| 23 | int use_hash;
|
| 24 |
|
| 25 | header = malloc(HEADER_LEN);
|
| 26 | - message = malloc(MESSAGE_LEN);
|
| 27 |
|
| 28 | for (use_hash = 0; use_hash <= 1; use_hash++) {
|
| 29 | table = parse_table(table_filename);
|
| 30 | @@ -115,22 +112,17 @@
|
| 31 | #ifdef DEBUG
|
| 32 | printf("\t0x%04x -> \"%s\"\n", values[j].value, check);
|
| 33 | #endif
|
| 34 | - snprintf(
|
| 35 | - message,
|
| 36 | - MESSAGE_LEN,
|
| 37 | +
|
| 38 | + ck_assert_msg(
|
| 39 | + values[j].expected != NULL ?
|
| 40 | + check != NULL && strcmp(check, values[j].expected) == 0 :
|
| 41 | + check == NULL,
|
| 42 | "%s, value = 0x%04X, expected = %s, output = %s",
|
| 43 | header,
|
| 44 | values[j].value,
|
| 45 | values[j].expected,
|
| 46 | check
|
| 47 | );
|
| 48 | -
|
| 49 | - if (values[j].expected != NULL) {
|
| 50 | - ck_assert_msg(check != NULL, message);
|
| 51 | - ck_assert_msg(strcmp(check, values[j].expected) == 0, message);
|
| 52 | - } else {
|
| 53 | - ck_assert_msg(check == NULL, message);
|
| 54 | - }
|
| 55 | }
|
| 56 | }
|
| 57 |
|