]> granicus.if.org Git - icinga2/blobdiff - test/base-timer.cpp
Add --units, --rate and --rate-multiplier support for the snmpv3 check command
[icinga2] / test / base-timer.cpp
index d7b1380c773d06aeb9c2c435240e2d26ce9c4a84..821b29e98dfa4c897aa9aa1d184838b37dfd4416 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * 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);
 }
@@ -61,7 +48,7 @@ static void Callback(int *counter)
 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);
 
@@ -76,7 +63,7 @@ BOOST_AUTO_TEST_CASE(invoke)
 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);