0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-10-18 01:54:08 +00:00

birdtest: in unit tests, bt_assert_bug() asserts that given function will produce bug with given message

This commit is contained in:
Katerina Kubecova 2024-03-27 14:22:32 +01:00 committed by Ondrej Zajicek
parent 0bcb1f9746
commit ee0711668f

22
lib/fail_test.c Normal file
View File

@ -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();
}