[icinga-checkins] icinga.org: icinga2/fix/foreign-architecture-builds-13403: test/base-timer : Workaround boost::bind problem on mips* architectures

git at icinga.org git at icinga.org
Fri Dec 16 18:31:00 CET 2016


Module: icinga2
Branch: fix/foreign-architecture-builds-13403
Commit: 5985134bf3650d3cb0dac5531db5e2ffc95ce681
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=5985134bf3650d3cb0dac5531db5e2ffc95ce681

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Fri Dec 16 18:26:43 2016 +0100

test/base-timer: Workaround boost::bind problem on mips* architectures

refs #13403

---

 test/base-timer.cpp |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/base-timer.cpp b/test/base-timer.cpp
index cd4404f..1f94dc6 100644
--- a/test/base-timer.cpp
+++ b/test/base-timer.cpp
@@ -39,16 +39,17 @@ BOOST_AUTO_TEST_CASE(interval)
 	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)
 {
-	int counter;
 	Timer::Ptr timer = new Timer();
-	timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
+	timer->OnTimerExpired.connect(&Callback);
 	timer->SetInterval(1);
 
 	counter = 0;
@@ -61,9 +62,8 @@ BOOST_AUTO_TEST_CASE(invoke)
 
 BOOST_AUTO_TEST_CASE(scope)
 {
-	int counter;
 	Timer::Ptr timer = new Timer();
-	timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
+	timer->OnTimerExpired.connect(&Callback);
 	timer->SetInterval(1);
 
 	counter = 0;



More information about the icinga-checkins mailing list