From 32e2fc07e16f452f0e6d2229a900b2d38b52ab28 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 24 Jan 2024 16:18:58 +0000 Subject: [PATCH] [Minor] Fix old test --- src/libstat/backends/redis_backend.cxx | 1 + test/rspamd_rrd_test.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libstat/backends/redis_backend.cxx b/src/libstat/backends/redis_backend.cxx index f5de68600..cd0c37965 100644 --- a/src/libstat/backends/redis_backend.cxx +++ b/src/libstat/backends/redis_backend.cxx @@ -905,6 +905,7 @@ rspamd_redis_process_tokens(struct rspamd_task *task, /* No need to do anything, as it is already done in the opposite class processing */ /* However, we need to store id as it is needed for further tokens processing */ rt->id = id; + rt->tokens = g_ptr_array_ref(tokens); return TRUE; } diff --git a/test/rspamd_rrd_test.c b/test/rspamd_rrd_test.c index 00d671192..2860cd8f6 100644 --- a/test/rspamd_rrd_test.c +++ b/test/rspamd_rrd_test.c @@ -1,11 +1,11 @@ -/*- - * Copyright 2016 Vsevolod Stakhov +/* + * Copyright 2024 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -46,13 +46,13 @@ void rspamd_rrd_test_func(void) rrd_make_default_rra("AVERAGE", pdp_per_cdp / 2, rows_cnt, &rra[1]); rrd_make_default_rra("AVERAGE", pdp_per_cdp / 4, rows_cnt, &rra[2]); rrd_make_default_rra("AVERAGE", pdp_per_cdp / 10, rows_cnt, &rra[3]); - ar.data = rra; + ar.data = (char *) rra; ar.len = sizeof(rra); g_assert(rspamd_rrd_add_rra(rrd, &ar, &err)); /* Add DS */ rrd_make_default_ds("test", "COUNTER", 1, &ds[0]); rrd_make_default_ds("test1", "COUNTER", 1, &ds[1]); - ar.data = ds; + ar.data = (char *) ds; ar.len = sizeof(ds); g_assert(rspamd_rrd_add_ds(rrd, &ar, &err)); /* Finalize */ @@ -66,7 +66,7 @@ void rspamd_rrd_test_func(void) for (i = 0; i < pdp_per_cdp * rows_cnt / 2; i++) { t[0] = i; t[1] = cnt++; - ar.data = t; + ar.data = (char *) t; ar.len = sizeof(t); ticks += 1.0; g_assert(rspamd_rrd_add_record(rrd, &ar, ticks, &err)); @@ -76,7 +76,7 @@ void rspamd_rrd_test_func(void) for (i = 0; i < pdp_per_cdp * rows_cnt / 4; i++) { t[0] = i + rspamd_time_jitter(1.0, 0.0); t[1] = cnt++; - ar.data = t; + ar.data = (char *) t; ar.len = sizeof(t); ticks += 1.0; g_assert(rspamd_rrd_add_record(rrd, &ar, ticks, &err)); @@ -89,7 +89,7 @@ void rspamd_rrd_test_func(void) for (i = 0; i < pdp_per_cdp * rows_cnt / 8; i++) { t[0] = i; t[1] = cnt++; - ar.data = t; + ar.data = (char *) t; ar.len = sizeof(t); ticks += 1.0; g_assert(rspamd_rrd_add_record(rrd, &ar, ticks, &err)); -- 2.39.5