X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FDebugModules.test.cc;h=854d7fd3f1562f785bc7ac4fcb22220eb4eb6e90;hb=2ffca72ed06b10829071cd1b28d9047ff735f929;hp=60cb8e85ebb53c09b8a435a835e77d74d439de53;hpb=7231c220a7332754de3d16e4e8aacd5dbd31c501;p=senf.git diff --git a/PPI/DebugModules.test.cc b/PPI/DebugModules.test.cc index 60cb8e8..854d7fd 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 @@ -31,16 +31,13 @@ #include #include -#define _senf_LOG_STREAM logstream -namespace { - std::stringstream logstream; -} +#define SENF_LOG_CONF (( (senf)(log)(Debug), (_), VERBOSE )) -#include "Packets/Packets.hh" +#include "../Packets/Packets.hh" #include "DebugModules.hh" #include "Setup.hh" -#include +#include "../Utils/auto_unit_test.hh" #include #define prefix_ @@ -132,18 +129,20 @@ BOOST_AUTO_UNIT_TEST(activeFeederSink) BOOST_CHECK( source.empty() ); } -BOOST_AUTO_UNIT_TEST(logWriter) +BOOST_AUTO_UNIT_TEST(logSink) { + senf::log::StringTarget logTarget; + logTarget.route(); + debug::ActiveFeederSource source; - debug::LogWriter<> sink; + 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_EQUAL( logstream.str(), - " 0000 13 24 35 .$5\n\n" ); + BOOST_CHECK( ! logTarget.str().empty() ); } ///////////////////////////////cc.e////////////////////////////////////////