/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
#include "test-lib.h"
#include "time-util.h"
#include "ioloop.h"
#include "lib-signals.h"
#include <unistd.h>
struct test_context_delayed {
};
static void
{
i_fatal("Failed to send signal: %m");
}
static void
{
}
static void
void *context ATTR_UNUSED)
{
(struct test_context_delayed *)context;
}
static void
test_lib_signals_delayed(void)
{
test_begin("lib-signals delayed - init lib-signals first");
ioloop = io_loop_create();
test_end();
test_begin("lib-signals delayed - init ioloop first");
ioloop = io_loop_create();
test_end();
}
static void
{
test_begin("lib-signals delayed in nested ioloop");
/* briefly run outer ioloop */
ioloop1 = io_loop_create();
/* run inner ioloop, which triggers the signal */
ioloop2 = io_loop_create();
test_end();
}
static void
{
test_begin("lib-signals delayed with NO_IOLOOP_AUTOMOVE - unmoved");
ioloop1 = io_loop_create();
/* briefly run outer ioloop */
/* run inner ioloop, which triggers the signal but musn't handle it */
ioloop2 = io_loop_create();
/* run outer ioloop once more */
test_end();
test_begin("lib-signals delayed with NO_IOLOOP_AUTOMOVE - moved");
ioloop1 = io_loop_create();
/* briefly run outer ioloop */
/* run inner ioloop, which triggers the signal */
ioloop2 = io_loop_create();
test_end();
}
void test_lib_signals(void)
{
}