mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6760 from Icinga/bugfix/armhf-stretch
armhf: Apply workaround for timer tests with std::bind callbacks
This commit is contained in:
commit
bd1cfc7bf9
|
@ -39,16 +39,17 @@ BOOST_AUTO_TEST_CASE(interval)
|
||||||
BOOST_CHECK(timer->GetInterval() == 1.5);
|
BOOST_CHECK(timer->GetInterval() == 1.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Callback(int *counter)
|
int counter = 0;
|
||||||
|
|
||||||
|
static void Callback(const Timer::Ptr&)
|
||||||
{
|
{
|
||||||
(*counter)++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(invoke)
|
BOOST_AUTO_TEST_CASE(invoke)
|
||||||
{
|
{
|
||||||
int counter;
|
|
||||||
Timer::Ptr timer = new Timer();
|
Timer::Ptr timer = new Timer();
|
||||||
timer->OnTimerExpired.connect(std::bind(&Callback, &counter));
|
timer->OnTimerExpired.connect(&Callback);
|
||||||
timer->SetInterval(1);
|
timer->SetInterval(1);
|
||||||
|
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
@ -61,9 +62,8 @@ BOOST_AUTO_TEST_CASE(invoke)
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(scope)
|
BOOST_AUTO_TEST_CASE(scope)
|
||||||
{
|
{
|
||||||
int counter;
|
|
||||||
Timer::Ptr timer = new Timer();
|
Timer::Ptr timer = new Timer();
|
||||||
timer->OnTimerExpired.connect(std::bind(&Callback, &counter));
|
timer->OnTimerExpired.connect(&Callback);
|
||||||
timer->SetInterval(1);
|
timer->SetInterval(1);
|
||||||
|
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
|
Loading…
Reference in New Issue