]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
birdtest: in unit tests, bt_assert_bug() asserts that given function will produce...
authorKaterina Kubecova <katerina.kubecova@nic.cz>
Wed, 27 Mar 2024 13:22:32 +0000 (14:22 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Tue, 23 Apr 2024 14:36:49 +0000 (16:36 +0200)
lib/fail_test.c [new file with mode: 0644]

diff --git a/lib/fail_test.c b/lib/fail_test.c
new file mode 100644 (file)
index 0000000..76792d5
--- /dev/null
@@ -0,0 +1,22 @@
+#include "test/birdtest.h"
+
+void
+just_bug_fce(void)
+{
+  bug("bug message");
+}
+
+static int
+t_check_bug(void)
+{
+  return bt_assert_bug(just_bug_fce, "bug message");
+}
+
+int
+main(int argc, char *argv[])
+{
+  bt_init(argc, argv);
+  bt_test_suite(t_check_bug,   "bug fce");
+
+  return bt_exit_value();
+}