X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftest_router_flexml.cpp;h=000ee0b44ffaa823d8dc95270e0cbb475e708e41;hb=b73cac9a4ef471b55177564f156e345f16b27704;hp=c082be36bb582d1b4e5ab6b7c75546fdcc4d2134;hpb=474111be67deb87130a5f0add13df89c89df346a;p=metaproxy-moved-to-github.git
diff --git a/src/test_router_flexml.cpp b/src/test_router_flexml.cpp
index c082be3..000ee0b 100644
--- a/src/test_router_flexml.cpp
+++ b/src/test_router_flexml.cpp
@@ -1,4 +1,4 @@
-/* $Id: test_router_flexml.cpp,v 1.3 2005-10-31 09:40:18 marc Exp $
+/* $Id: test_router_flexml.cpp,v 1.7 2005-12-08 22:32:58 adam Exp $
Copyright (c) 2005, Index Data.
%LICENSE%
@@ -22,43 +22,89 @@ public:
};
-BOOST_AUTO_TEST_CASE( test_router_flexml_1 )
+BOOST_AUTO_UNIT_TEST( test_router_flexml_1 )
{
- try{
- TFilter filter;
-
- std::string xmlconf = ""
- ""
- ""
- ""
- ""
- "210"
- ""
- ""
- "mylog.log"
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- ""
- "";
-
+ try
+ {
+ std::string xmlconf = "\n"
+ "\n"
+ " \n"
+ " \n"
+ " \n"
+ " 210\n"
+ " \n"
+ " \n"
+ " mylog.log\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ "\n";
yp2::RouterFleXML rflexml(xmlconf);
-
-
- BOOST_CHECK (true);
+ }
+ catch ( ... ) {
+ BOOST_CHECK (false);
+ }
+}
- //BOOST_CHECK_EQUAL(filter.name(), std::string("filter1"));
+BOOST_AUTO_UNIT_TEST( test_router_flexml_2 )
+{
+ bool got_xml_error = false;
+ try
+ {
+ std::string xmlconf_invalid = "\n"
+ "\n"
+ " \n"
+ " \n"
+ " \n"
+ " 210\n";
+ yp2::RouterFleXML rflexml(xmlconf_invalid);
+ }
+ catch ( yp2::RouterFleXML::XMLError &e) {
+ got_xml_error = true;
+ }
+ catch ( ... ) {
+ ;
+ }
+ BOOST_CHECK(got_xml_error);
+}
+
+BOOST_AUTO_UNIT_TEST( test_router_flexml_3 )
+{
+ try
+ {
+ std::string xmlconf = "\n"
+ "\n"
+ " \n"
+ " \n"
+ " \n"
+ " 210\n"
+ " \n"
+ " \n"
+ " mylog.log\n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ "\n";
+
+ yp2::RouterFleXML rflexml(xmlconf);
}
catch ( ... ) {
BOOST_CHECK (false);
}
}
+
/*
* Local variables:
* c-basic-offset: 4