/******************************************************************************
* Icinga 2 *
- * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org) *
+ * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
using namespace icinga;
-struct TimerFixture
-{
- TimerFixture(void)
- {
- Timer::Initialize();
- }
-
- ~TimerFixture(void)
- {
- Timer::Uninitialize();
- }
-};
-
-BOOST_FIXTURE_TEST_SUITE(base_timer, TimerFixture)
+BOOST_AUTO_TEST_SUITE(base_timer)
BOOST_AUTO_TEST_CASE(construct)
{
- Timer::Ptr timer = make_shared<Timer>();
+ Timer::Ptr timer = new Timer();
BOOST_CHECK(timer);
}
BOOST_AUTO_TEST_CASE(interval)
{
- Timer::Ptr timer = make_shared<Timer>();
+ Timer::Ptr timer = new Timer();
timer->SetInterval(1.5);
BOOST_CHECK(timer->GetInterval() == 1.5);
}
BOOST_AUTO_TEST_CASE(invoke)
{
int counter;
- Timer::Ptr timer = make_shared<Timer>();
+ Timer::Ptr timer = new Timer();
timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
timer->SetInterval(1);
BOOST_AUTO_TEST_CASE(scope)
{
int counter;
- Timer::Ptr timer = make_shared<Timer>();
+ Timer::Ptr timer = new Timer();
timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
timer->SetInterval(1);