]> granicus.if.org Git - icinga2/blobdiff - test/base-timer.cpp
Update copyright header.
[icinga2] / test / base-timer.cpp
index b7431e3e9c237465f4ff79080cd63fed3bb21128..1545539bba245432ce1fd793aa1a267fd57692d0 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012 Icinga Development Team (http://www.icinga.org/)        *
+ * Copyright (C) 2012-present Icinga Development Team (http://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                *
@@ -21,9 +21,7 @@
 #include "base/utility.h"
 #include "base/application.h"
 #include <boost/test/unit_test.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
 #include <boost/foreach.hpp>
-#include <iostream>
 
 using namespace icinga;
 
@@ -44,13 +42,13 @@ BOOST_FIXTURE_TEST_SUITE(base_timer, TimerFixture)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       Timer::Ptr timer = boost::make_shared<Timer>();
+       Timer::Ptr timer = make_shared<Timer>();
        BOOST_CHECK(timer);
 }
 
 BOOST_AUTO_TEST_CASE(interval)
 {
-       Timer::Ptr timer = boost::make_shared<Timer>();
+       Timer::Ptr timer = make_shared<Timer>();
        timer->SetInterval(1.5);
        BOOST_CHECK(timer->GetInterval() == 1.5);
 }
@@ -63,7 +61,7 @@ static void Callback(int *counter)
 BOOST_AUTO_TEST_CASE(invoke)
 {
        int counter;
-       Timer::Ptr timer = boost::make_shared<Timer>();
+       Timer::Ptr timer = make_shared<Timer>();
        timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
        timer->SetInterval(1);
 
@@ -72,14 +70,13 @@ BOOST_AUTO_TEST_CASE(invoke)
        Utility::Sleep(5.5);
        timer->Stop();
 
-       std::cout << counter << std::endl;
        BOOST_CHECK(counter >= 4 && counter <= 6);
 }
 
 BOOST_AUTO_TEST_CASE(scope)
 {
        int counter;
-       Timer::Ptr timer = boost::make_shared<Timer>();
+       Timer::Ptr timer = make_shared<Timer>();
        timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
        timer->SetInterval(1);
 
@@ -89,7 +86,6 @@ BOOST_AUTO_TEST_CASE(scope)
        timer.reset();
        Utility::Sleep(5.5);
 
-       std::cout << counter << std::endl;
        BOOST_CHECK(counter >= 4 && counter <= 6);
 }