test: add fallback for SIGALRM

This commit is contained in:
Azat Khuzhin 2024-10-28 10:06:45 +01:00
parent c94b382577
commit 7b14bc16f2

View File

@ -1044,12 +1044,22 @@ signal_cb(evutil_socket_t fd, short event, void *arg)
test_ok = 1;
}
static void
signal_alarm_fallback(int sig)
{
TT_DIE(("ALRM received not from event loop!"));
end:
;
}
static void
test_simple_signal_impl(int find_reorder)
{
struct event ev;
struct itimerval itv;
signal(SIGALRM, signal_alarm_fallback);
evsignal_set(&ev, SIGALRM, signal_cb, &ev);
evsignal_add(&ev, NULL);
/* find bugs in which operations are re-ordered */
@ -1124,6 +1134,8 @@ test_multiplesignal(void)
setup_test("Multiple signal: ");
signal(SIGALRM, signal_alarm_fallback);
evsignal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
evsignal_add(&ev_one, NULL);