From 8f3c6151b4ff11d98a20f6f9919723f0fb719161 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Fri, 4 Mar 2022 02:01:34 +0100 Subject: Nest: Cleanups in as_path_filter() Use struct f_val as a common argument for as_path_filter(), as suggested by Alexander Zubkov. That allows to use NULL sets as valid arguments. --- nest/a-path_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nest/a-path_test.c') diff --git a/nest/a-path_test.c b/nest/a-path_test.c index 9ed0a786..97924c00 100644 --- a/nest/a-path_test.c +++ b/nest/a-path_test.c @@ -12,6 +12,7 @@ #include "nest/route.h" #include "nest/attrs.h" #include "lib/resource.h" +#include "filter/data.h" #define TESTS_NUM 30 #define AS_PATH_LENGTH 1000 @@ -136,8 +137,9 @@ t_path_include(void) int counts_of_contains = count_asn_in_array(as_nums, as_nums[i]); bt_assert_msg(as_path_contains(as_path, as_nums[i], counts_of_contains), "AS Path should contains %d-times number %d", counts_of_contains, as_nums[i]); - bt_assert(as_path_filter(lp, as_path, NULL, as_nums[i], 0) != NULL); - bt_assert(as_path_filter(lp, as_path, NULL, as_nums[i], 1) != NULL); + struct f_val v = { .type = T_INT, .val.i = as_nums[i] }; + bt_assert(as_path_filter(lp, as_path, &v, 0) != NULL); + bt_assert(as_path_filter(lp, as_path, &v, 1) != NULL); } for (i = 0; i < 10000; i++) -- cgit v1.2.3