From: g0dil Date: Tue, 3 Feb 2009 10:54:49 +0000 (+0000) Subject: I'm too tired ?? X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=054f407988120bf96b648ad61068073e22db4f00;p=senf.git I'm too tired ?? git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1095 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Logger/Target.cc b/Utils/Logger/Target.cc index a277dd5..75927e2 100644 --- a/Utils/Logger/Target.cc +++ b/Utils/Logger/Target.cc @@ -120,7 +120,7 @@ prefix_ void senf::log::Target::clear() RIB::const_iterator const i_end (old.end()); for (; i != i_end; ++i) if (i->action_ == ACCEPT) - updateRoutingCache(i->stream_, i->area_) + updateRoutingCache(i->stream_, i->area_); } //////////////////////////////////////// diff --git a/Utils/Logger/Target.cci b/Utils/Logger/Target.cci index 6027939..014f64c 100644 --- a/Utils/Logger/Target.cci +++ b/Utils/Logger/Target.cci @@ -56,14 +56,14 @@ prefix_ senf::log::Target::iterator senf::log::Target::end() return rib_.end(); } -prefix_ RoutingEntry const & senf::log::Target::operator[](size_type i) - size_type size() const +prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i) + const { return rib_[i]; } -prefix_ RoutingEntry const & senf::log::Target::operator[](size_type i) - size_type size() const +prefix_ senf::log::Target::size_type senf::log::Target::size() + const { return rib_.size(); } diff --git a/Utils/Logger/Target.hh b/Utils/Logger/Target.hh index e969f1a..502bae8 100644 --- a/Utils/Logger/Target.hh +++ b/Utils/Logger/Target.hh @@ -333,7 +333,7 @@ namespace log { iterator begin() const; ///< Iterator to beginning of routing table iterator end() const; ///< Iterator past the end of routing table - RoutingEntry const & operator[](size_type i) ///< Access routing entry + RoutingEntry const & operator[](size_type i) const; ///< Access routing entry size_type size() const; ///< Number of routing table entries bool empty() const; ///< \c true, if routing table empty, \c false otherwise diff --git a/Utils/Logger/Target.test.cc b/Utils/Logger/Target.test.cc index cdcaed1..b19f03f 100644 --- a/Utils/Logger/Target.test.cc +++ b/Utils/Logger/Target.test.cc @@ -86,17 +86,19 @@ BOOST_AUTO_UNIT_TEST(target) }; BOOST_CHECK_EQUAL_COLLECTIONS( i, i_end, data, data + sizeof(data)/sizeof(data[0]) ); + BOOST_CHECK_EQUAL( *target.begin(), target[0] ); target.unroute(); target.unroute(); target.unroute(senf::log::Target::REJECT); - target.unroute(); target.unroute("senf::log::test::myStream", "", senf::log::IMPORTANT::value, senf::log::Target::REJECT); target.unroute(1); - target.unroute(0); + target.clear(); BOOST_CHECK( target.begin() == target.end() ); + BOOST_CHECK( target.empty() ); + BOOST_CHECK( target.size() == 0 ); } ///////////////////////////////cc.e////////////////////////////////////////