Skip to content

Commit d6e65fb

Browse files
committed
tests: runtime: clean warning fixes in runtime tests
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
1 parent c8042b0 commit d6e65fb

4 files changed

Lines changed: 9 additions & 19 deletions

File tree

tests/runtime/core_internal_logger.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int assert_internal_log_metrics(struct http_client_ctx *http_ctx, int fail_test)
100100
return -1;
101101
}
102102

103-
TEST_MSG(http_client->resp.payload);
103+
TEST_MSG("%s", http_client->resp.payload);
104104
if (!TEST_CHECK(http_client->resp.status == 200)) {
105105
TEST_MSG("http response code error. expect: 200, got: %d\n",
106106
http_client->resp.status);
@@ -123,7 +123,8 @@ int assert_internal_log_metrics(struct http_client_ctx *http_ctx, int fail_test)
123123
return -1;
124124
}
125125
if (!TEST_CHECK(flb_regex_match(
126-
regex, http_client->resp.payload, http_client->resp.payload_size))) {
126+
regex, (unsigned char *) http_client->resp.payload,
127+
http_client->resp.payload_size))) {
127128
TEST_MSG("response payload: %s\n", http_client->resp.payload);
128129
}
129130

@@ -142,9 +143,6 @@ static void test_internal_log_metrics()
142143
flb_ctx_t *ctx;
143144
int ret;
144145
struct http_client_ctx *http_ctx;
145-
struct flb_http_client *http_client;
146-
size_t b_sent;
147-
struct flb_regex *regex;
148146
int i;
149147
int attempt_count = 30;
150148

tests/runtime/custom_calyptia_registration_retry_test.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ static void mock_server_cb_empty_token(mk_request_t *request, void *data)
2626
mk_http_status(request, 200);
2727
mk_http_header(request, "Content-Type", sizeof("Content-Type") - 1,
2828
"application/json", sizeof("application/json") - 1);
29-
mk_http_send(request, response, response_len, NULL); // Use response_len
29+
mk_http_send(request, (char *) response, response_len, NULL);
3030
} else {
3131
mk_http_status(request, 500);
3232
mk_http_header(request, "Content-Type", sizeof("Content-Type") - 1,
3333
"text/plain", sizeof("text/plain") - 1);
34-
mk_http_send(request, "Internal Server Error", sizeof("Internal Server Error") - 1, NULL);
34+
mk_http_send(request, (char *) "Internal Server Error",
35+
sizeof("Internal Server Error") - 1, NULL);
3536
}
3637
mk_http_done(request);
3738
}
@@ -42,7 +43,8 @@ static void mock_server_cb(mk_request_t *request, void *data)
4243
mk_http_status(request, 500);
4344
mk_http_header(request, "Content-Type", sizeof("Content-Type") - 1,
4445
"text/plain", sizeof("text/plain") - 1);
45-
mk_http_send(request, "Internal Server Error", sizeof("Internal Server Error") - 1, NULL);
46+
mk_http_send(request, (char *) "Internal Server Error",
47+
sizeof("Internal Server Error") - 1, NULL);
4648
mk_http_done(request);
4749
}
4850

@@ -310,4 +312,4 @@ TEST_LIST = {
310312
{"register_retry_empty_token", test_calyptia_register_retry_empty_token},
311313
{"register_retry_empty_token_retry_true", test_calyptia_register_retry_empty_token_retry_true},
312314
{NULL, NULL}
313-
};
315+
};

tests/runtime/in_forward.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -625,9 +625,6 @@ void flb_test_forward_gzip()
625625
int num;
626626
ssize_t w_size;
627627

628-
char *buf;
629-
size_t size;
630-
631628
msgpack_sbuffer sbuf;
632629

633630
clear_output_num();
@@ -736,9 +733,6 @@ void flb_test_forward_zstd()
736733
int num;
737734
ssize_t w_size;
738735

739-
char *buf;
740-
size_t size;
741-
742736
msgpack_sbuffer sbuf;
743737

744738
clear_output_num();

tests/runtime/in_podman_metrics.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,10 @@ int check_metric(flb_ctx_t *ctx, char *name) {
5959

6060
void do_create(flb_ctx_t *ctx, char *system, ...)
6161
{
62-
int64_t ret;
6362
int in_ffd;
64-
int out_ffd;
6563
va_list va;
6664
char *key;
6765
char *value;
68-
struct flb_lib_out_cb cb;
69-
cb.data = NULL;
7066

7167
in_ffd = flb_input(ctx, (char *) system, NULL);
7268

0 commit comments

Comments
 (0)