I'm too tired ??
g0dil [Tue, 3 Feb 2009 10:54:49 +0000 (10:54 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1095 270642c3-0616-0410-b53a-bc976706d245

Utils/Logger/Target.cc
Utils/Logger/Target.cci
Utils/Logger/Target.hh
Utils/Logger/Target.test.cc

index a277dd5..75927e2 100644 (file)
@@ -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_);
 }
 
 ////////////////////////////////////////
index 6027939..014f64c 100644 (file)
@@ -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();
 }
index e969f1a..502bae8 100644 (file)
@@ -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
index cdcaed1..b19f03f 100644 (file)
@@ -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<senf::log::Debug>();
     target.unroute<senf::log::test::myStream, senf::log::VERBOSE>();
     target.unroute<senf::log::test::myStream, senf::log::DefaultArea>(senf::log::Target::REJECT);
-    target.unroute<senf::log::test::myStream, senf::log::test::Foo, senf::log::VERBOSE>();
     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////////////////////////////////////////