mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-10-18 09:58:43 +00:00
birdtest: in unit tests, bt_assert_bug() asserts that given function will produce bug with given message
This commit is contained in:
parent
0bcb1f9746
commit
ee0711668f
22
lib/fail_test.c
Normal file
22
lib/fail_test.c
Normal 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();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user