From f1d6c66a78758449f00ed709891e24ab3571cc9c Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 1 Aug 2022 15:17:41 +0200 Subject: Fixed main birdloop init in unit tests Some unit tests weren't initializing the birdloop, trying to write the birdloop ping into stdin. Fixed this and also forced stdin close on startup of every test just to be sure that CI and local build behave the same in this. (CI was failing on this while local build not.) --- test/birdtest.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/birdtest.c') diff --git a/test/birdtest.c b/test/birdtest.c index 2ae7b51e..5e3de1c5 100644 --- a/test/birdtest.c +++ b/test/birdtest.c @@ -65,6 +65,9 @@ bt_init(int argc, char *argv[]) { int c; + /* We have no interest in stdin */ + close(0); + initstate(BT_RANDOM_SEED, (char *) bt_random_state, sizeof(bt_random_state)); bt_verbose = 0; @@ -121,9 +124,11 @@ bt_init(int argc, char *argv[]) clock_gettime(CLOCK_MONOTONIC, &bt_begin); bt_suite_case_begin = bt_suite_begin = bt_begin; + the_bird_lock(); resource_init(); ev_init_list(&global_event_list, &main_birdloop, "Global event list in unit tests"); ev_init_list(&global_work_list, &main_birdloop, "Global work list in unit tests"); + birdloop_init(); return; usage: -- cgit v1.2.3