From: Guilherme Maciel Ferreira Date: Fri, 20 Jan 2012 10:15:53 +0000 (-0200) Subject: Test: bring aboard the LinkStatusAnalyzer mock required by HostStatusAnalyzer. X-Git-Tag: v1.3~11^2~39 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=7c8291c8867cfef6b7c634a95d1b53aa76f4ef4a;p=pingcheck Test: bring aboard the LinkStatusAnalyzer mock required by HostStatusAnalyzer. --- diff --git a/test/mock_linkstatusanalyzer.cpp b/test/mock_linkstatusanalyzer.cpp new file mode 100644 index 0000000..722733b --- /dev/null +++ b/test/mock_linkstatusanalyzer.cpp @@ -0,0 +1,39 @@ +/* +The software in this package is distributed under the GNU General +Public License version 2 (with a special exception described below). + +A copy of GNU General Public License (GPL) is included in this distribution, +in the file COPYING.GPL. + +As a special exception, if other files instantiate templates or use macros +or inline functions from this file, or you compile this file and link it +with other works to produce a work based on this file, this file +does not by itself cause the resulting work to be covered +by the GNU General Public License. + +However the source code for this file must still be made available +in accordance with section (3) of the GNU General Public License. + +This exception does not invalidate any other reasons why a work based +on this file might be covered by the GNU General Public License. +*/ + +#include "mock_linkstatusanalyzer.h" + +using namespace std; + +LinkStatusAnalyzer::LinkStatusAnalyzer() +{ +} + +LinkStatusAnalyzer::~LinkStatusAnalyzer() +{ +} + +void LinkStatusAnalyzer::notify_host_up( const string &host_address ) +{ +} + +void LinkStatusAnalyzer::notify_host_down( const string &host_address ) +{ +} diff --git a/test/mock_linkstatusanalyzer.h b/test/mock_linkstatusanalyzer.h new file mode 100644 index 0000000..d116b13 --- /dev/null +++ b/test/mock_linkstatusanalyzer.h @@ -0,0 +1,53 @@ +/* +The software in this package is distributed under the GNU General +Public License version 2 (with a special exception described below). + +A copy of GNU General Public License (GPL) is included in this distribution, +in the file COPYING.GPL. + +As a special exception, if other files instantiate templates or use macros +or inline functions from this file, or you compile this file and link it +with other works to produce a work based on this file, this file +does not by itself cause the resulting work to be covered +by the GNU General Public License. + +However the source code for this file must still be made available +in accordance with section (3) of the GNU General Public License. + +This exception does not invalidate any other reasons why a work based +on this file might be covered by the GNU General Public License. +*/ + +#ifndef LINKSTATUSANALYZER_H +#define LINKSTATUSANALYZER_H + +#include + +#include + +//----------------------------------------------------------------------------- +// LinkStatusAnalyzer +//----------------------------------------------------------------------------- + +/** + * @brief This is a fake link status class. + * Scope: one object for many hosts. + */ +class LinkStatusAnalyzer +{ +public: + LinkStatusAnalyzer(); + ~LinkStatusAnalyzer(); + + void notify_host_up( const std::string &host_address ); + void notify_host_down( const std::string &host_address ); + +}; + +//----------------------------------------------------------------------------- +// LinkStatusAnalyzerItem +//----------------------------------------------------------------------------- + +typedef boost::shared_ptr LinkStatusAnalyzerItem; + +#endif // LINKSTATUSANALYZER_H