mirror of
https://github.com/opnsense/src.git
synced 2026-02-25 11:00:15 -05:00
I intend to move these into lib/libthr/tests/ and connect to kyua. This is a first step to address warnings emitted when building using standard make infrastructure. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34306
37 lines
601 B
C++
37 lines
601 B
C++
/* $FreeBSD$ */
|
|
|
|
static int destructed;
|
|
static int destructed2;
|
|
|
|
class Test {
|
|
public:
|
|
Test() { printf("Test::Test()\n"); }
|
|
~Test() { printf("Test::~Test()\n"); destructed = 1; }
|
|
};
|
|
|
|
void
|
|
cleanup_handler(void *arg __unused)
|
|
{
|
|
destructed2 = 1;
|
|
printf("%s()\n", __func__);
|
|
}
|
|
|
|
void
|
|
check_destruct(void)
|
|
{
|
|
if (!destructed)
|
|
printf("Bug, object destructor is not called\n");
|
|
else
|
|
printf("OK\n");
|
|
}
|
|
|
|
void
|
|
check_destruct2(void)
|
|
{
|
|
if (!destructed)
|
|
printf("Bug, object destructor is not called\n");
|
|
else if (!destructed2)
|
|
printf("Bug, cleanup handler is not called\n");
|
|
else
|
|
printf("OK\n");
|
|
}
|