added some tests to increase test coverage
tho [Fri, 20 Mar 2009 10:24:21 +0000 (10:24 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1161 270642c3-0616-0410-b53a-bc976706d245

PPI/RateFilter.test.cc
Utils/Logger/Target.test.cc

index 22a5a1c..923eb86 100644 (file)
@@ -64,6 +64,7 @@ BOOST_AUTO_UNIT_TEST(rateFilter)
     
     senf::ppi::run();
 
+    BOOST_CHECK_EQUAL( rateFilter.interval(), senf::ClockService::milliseconds(100) );
     BOOST_CHECK_EQUAL( sink.size(), 2);
 }
 
@@ -104,6 +105,7 @@ BOOST_AUTO_UNIT_TEST(rateFilter_changeInterval)
     
     senf::ppi::run();
 
+    BOOST_CHECK_EQUAL( rateFilter.interval(), senf::ClockService::milliseconds(200) );
     BOOST_CHECK_EQUAL( sink.size(), 4);
 }
 
index a4f5cf3..1a643b0 100644 (file)
@@ -59,6 +59,15 @@ BOOST_AUTO_UNIT_TEST(target)
 {
     senf::log::StringTarget target;
 
+    BOOST_CHECK_THROW( target.route("senf::log::test::myStream", "invalid_area"), 
+            senf::log::Target::InvalidAreaException );
+    BOOST_CHECK_THROW( target.route("invalid_stream", ""),
+            senf::log::Target::InvalidStreamException );
+    BOOST_CHECK_THROW( target.unroute("senf::log::test::myStream", "invalid_area"), 
+            senf::log::Target::InvalidAreaException );
+    BOOST_CHECK_THROW( target.unroute("invalid_stream", ""),
+            senf::log::Target::InvalidStreamException );
+
     target.route<senf::log::Debug>();
     target.route<senf::log::test::myStream, senf::log::DefaultArea>(senf::log::Target::REJECT);
     target.route<senf::log::test::myStream, senf::log::VERBOSE>(senf::log::Target::ACCEPT, 0);