aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-04-21 13:49:29 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-09-25 16:06:43 +0200
commite709dc09e61c4604821d10b81604d38616b81a0b (patch)
treebcbaa8cb114fa4dedfe68b866abf7e364bc87273 /test
parentdd61278c9db1d4bea29f0a21aa460c7fe931eb32 (diff)
downloadbird-e709dc09e61c4604821d10b81604d38616b81a0b.tar.gz
Filter: Improve prefix trie tests
Add tests explicitly matching insides and outsides of trie and update tests to do testing of both IPv4 and IPv6 tries.
Diffstat (limited to 'test')
-rw-r--r--test/birdtest.c6
-rw-r--r--test/birdtest.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/test/birdtest.c b/test/birdtest.c
index a1da078f..d739e78b 100644
--- a/test/birdtest.c
+++ b/test/birdtest.c
@@ -501,6 +501,12 @@ bt_fmt_ipa(char *buf, size_t size, const void *data)
bsnprintf(buf, size, "(null)");
}
+void
+bt_format_net(char *buf, size_t size, const void *data)
+{
+ bsnprintf(buf, size, "%N", (const net_addr *) data);
+}
+
int
bt_is_char(byte c)
{
diff --git a/test/birdtest.h b/test/birdtest.h
index caec529b..7a0c2fc4 100644
--- a/test/birdtest.h
+++ b/test/birdtest.h
@@ -165,6 +165,8 @@ struct bt_batch {
void bt_fmt_str(char *buf, size_t size, const void *data);
void bt_fmt_unsigned(char *buf, size_t size, const void *data);
void bt_fmt_ipa(char *buf, size_t size, const void *data);
+void bt_format_net(char *buf, size_t size, const void *data);
+
int bt_assert_batch__(struct bt_batch *opts);
int bt_is_char(byte c);