X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FDebugModules.test.cc;h=fa198bd07e457447654f8e46b78894255fcdbd69;hb=fd3a0e8ac95d1158e9ea661ddf9187b67c70169f;hp=1f6f668812af28d3dd3b49f331870f832b309c25;hpb=69535909437d04c0df8f95bfb242db4f36fda12d;p=senf.git diff --git a/PPI/DebugModules.test.cc b/PPI/DebugModules.test.cc index 1f6f668..fa198bd 100644 --- a/PPI/DebugModules.test.cc +++ b/PPI/DebugModules.test.cc @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -21,18 +21,22 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief DebubgModules.test unit tests */ + \brief DebubgModules unit tests */ //#include "DebubgModules.test.hh" //#include "DebubgModules.test.ih" // Custom includes #include -#include "Packets/Packets.hh" +#include + +#define SENF_LOG_CONF (( (senf)(log)(Debug), (_), VERBOSE )) + +#include "../Packets/Packets.hh" #include "DebugModules.hh" #include "Setup.hh" -#include +#include "../Utils/auto_unit_test.hh" #include #define prefix_ @@ -97,9 +101,7 @@ BOOST_AUTO_UNIT_TEST(activeFeederSource) debug::PassiveSink sink; ppi::connect(source,sink); - source.submit(senf::DataPacket::create()); - ppi::run(); BOOST_CHECK( source.empty() ); @@ -113,9 +115,7 @@ BOOST_AUTO_UNIT_TEST(activeFeederSink) debug::ActiveFeederSink sink; ppi::connect(source,sink); - source.submit(senf::DataPacket::create()); - ppi::run(); BOOST_CHECK( ! sink.empty() ); @@ -128,6 +128,22 @@ BOOST_AUTO_UNIT_TEST(activeFeederSink) BOOST_CHECK( source.empty() ); } +BOOST_AUTO_UNIT_TEST(logSink) +{ + senf::log::StringTarget logTarget; + logTarget.route(); + + debug::ActiveFeederSource source; + debug::LogSink<> sink; + + ppi::connect(source,sink); + senf::PacketData::byte data[] = { 0x13u, 0x24u, 0x35u }; + source.submit( senf::DataPacket::create(data) ); + senf::ppi::run(); + + BOOST_CHECK( ! logTarget.str().empty() ); +} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_