diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-06 16:11:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-06 16:11:30 +0000 |
commit | aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7 (patch) | |
tree | 941cbdd387b41c1a81587c20a6df9f0e5e0ff7ab /exporting/tests | |
parent | Adding upstream version 1.37.1. (diff) | |
download | netdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.tar.xz netdata-aa2fe8ccbfcb117efa207d10229eeeac5d0f97c7.zip |
Adding upstream version 1.38.0.upstream/1.38.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exporting/tests')
-rw-r--r-- | exporting/tests/test_exporting_engine.c | 26 | ||||
-rw-r--r-- | exporting/tests/test_exporting_engine.h | 3 |
2 files changed, 13 insertions, 16 deletions
diff --git a/exporting/tests/test_exporting_engine.c b/exporting/tests/test_exporting_engine.c index 6ea6b1e5c..418be0b01 100644 --- a/exporting/tests/test_exporting_engine.c +++ b/exporting/tests/test_exporting_engine.c @@ -612,7 +612,7 @@ static void test_exporting_discard_response(void **state) { struct engine *engine = *state; - BUFFER *response = buffer_create(0); + BUFFER *response = buffer_create(0, NULL); buffer_sprintf(response, "Test response"); assert_int_equal(exporting_discard_response(response, engine->instance_root), 0); @@ -651,8 +651,8 @@ static void test_simple_connector_send_buffer(void **state) int sock = 1; int failures = 3; size_t buffered_metrics = 1; - BUFFER *header = buffer_create(0); - BUFFER *buffer = buffer_create(0); + BUFFER *header = buffer_create(0, NULL); + BUFFER *buffer = buffer_create(0, NULL); buffer_strcat(header, "test header\n"); buffer_strcat(buffer, "test buffer\n"); @@ -695,10 +695,10 @@ static void test_simple_connector_worker(void **state) instance->connector_specific_data = simple_connector_data; simple_connector_data->last_buffer = callocz(1, sizeof(struct simple_connector_buffer)); simple_connector_data->first_buffer = simple_connector_data->last_buffer; - simple_connector_data->header = buffer_create(0); - simple_connector_data->buffer = buffer_create(0); - simple_connector_data->last_buffer->header = buffer_create(0); - simple_connector_data->last_buffer->buffer = buffer_create(0); + simple_connector_data->header = buffer_create(0, NULL); + simple_connector_data->buffer = buffer_create(0, NULL); + simple_connector_data->last_buffer->header = buffer_create(0, NULL); + simple_connector_data->last_buffer->buffer = buffer_create(0, NULL); strcpy(simple_connector_data->connected_to, "localhost"); buffer_sprintf(simple_connector_data->last_buffer->header, "test header"); @@ -822,7 +822,7 @@ static void test_flush_host_labels(void **state) struct engine *engine = *state; struct instance *instance = engine->instance_root; - instance->labels_buffer = buffer_create(12); + instance->labels_buffer = buffer_create(12, NULL); buffer_strcat(instance->labels_buffer, "check string"); assert_int_equal(buffer_strlen(instance->labels_buffer), 12); @@ -1133,7 +1133,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus(void **state) { (void)state; - BUFFER *buffer = buffer_create(0); + BUFFER *buffer = buffer_create(0, NULL); RRDSET *st; rrdset_foreach_read(st, localhost); @@ -1241,8 +1241,8 @@ static void test_prometheus_remote_write_prepare_header(void **state) struct simple_connector_data *simple_connector_data = callocz(1, sizeof(struct simple_connector_data)); instance->connector_specific_data = simple_connector_data; simple_connector_data->last_buffer = callocz(1, sizeof(struct simple_connector_buffer)); - simple_connector_data->last_buffer->header = buffer_create(0); - simple_connector_data->last_buffer->buffer = buffer_create(0); + simple_connector_data->last_buffer->header = buffer_create(0, NULL); + simple_connector_data->last_buffer->buffer = buffer_create(0, NULL); strcpy(simple_connector_data->connected_to, "localhost"); buffer_sprintf(simple_connector_data->last_buffer->buffer, "test buffer"); @@ -1269,7 +1269,7 @@ static void test_prometheus_remote_write_prepare_header(void **state) static void test_process_prometheus_remote_write_response(void **state) { (void)state; - BUFFER *buffer = buffer_create(0); + BUFFER *buffer = buffer_create(0, NULL); buffer_sprintf(buffer, "HTTP/1.1 200 OK\r\n"); assert_int_equal(process_prometheus_remote_write_response(buffer, NULL), 0); @@ -1834,7 +1834,7 @@ static void test_format_batch_mongodb(void **state) connector_specific_data->first_buffer->next = current_buffer; connector_specific_data->last_buffer = current_buffer; - BUFFER *buffer = buffer_create(0); + BUFFER *buffer = buffer_create(0, NULL); buffer_sprintf(buffer, "{ \"metric\": \"test_metric\" }\n"); instance->buffer = buffer; stats->buffered_metrics = 1; diff --git a/exporting/tests/test_exporting_engine.h b/exporting/tests/test_exporting_engine.h index a9180a518..24dac8630 100644 --- a/exporting/tests/test_exporting_engine.h +++ b/exporting/tests/test_exporting_engine.h @@ -55,9 +55,6 @@ int __wrap_connect_to_one_of( size_t *reconnects_counter, char *connected_to, size_t connected_to_size); -void __rrdhost_check_rdlock(RRDHOST *host, const char *file, const char *function, const unsigned long line); -void __rrdset_check_rdlock(RRDSET *st, const char *file, const char *function, const unsigned long line); -void __rrd_check_rdlock(const char *file, const char *function, const unsigned long line); time_t __mock_rrddim_query_oldest_time(STORAGE_METRIC_HANDLE *db_metric_handle); time_t __mock_rrddim_query_latest_time(STORAGE_METRIC_HANDLE *db_metric_handle); void __mock_rrddim_query_init(STORAGE_METRIC_HANDLE *db_metric_handle, struct rrddim_query_handle *handle, time_t start_time, time_t end_time); |