*** empty log message ***
[metaproxy-moved-to-github.git] / src / test_filter_factory.cpp
index b9190e3..3b6be2c 100644 (file)
@@ -1,8 +1,7 @@
-/* $Id: test_filter_factory.cpp,v 1.7 2005-12-10 09:59:10 adam Exp $
+/* $Id: test_filter_factory.cpp,v 1.11 2006-01-19 09:41:01 adam Exp $
    Copyright (c) 2005, Index Data.
 
 %LICENSE%
-
 */
 
 #include <iostream>
@@ -11,7 +10,7 @@
 #include "config.hpp"
 #include "filter.hpp"
 #include "package.hpp"
-#include "filter_factory.hpp"
+#include "factory_filter.hpp"
 
 
 #define BOOST_AUTO_TEST_MAIN
@@ -53,7 +52,7 @@ BOOST_AUTO_UNIT_TEST( test_filter_factory_1 )
 {
     try {
         
-        yp2::FilterFactory  ffactory;
+        yp2::FactoryFilter  ffactory;
         
         XFilter xf;
         YFilter yf;
@@ -87,16 +86,21 @@ BOOST_AUTO_UNIT_TEST( test_filter_factory_1 )
     }
 }
 
+#if HAVE_DL_SUPPORT
 #if HAVE_DLFCN_H
 BOOST_AUTO_UNIT_TEST( test_filter_factory_2 )
 {
     try {        
-        yp2::FilterFactory  ffactory;
+        yp2::FactoryFilter  ffactory;
         
         const std::string id = "dl";
         
-        BOOST_CHECK(ffactory.add_creator_dyn(id, ".libs"));
-        
+        // first load
+        BOOST_CHECK(ffactory.add_creator_dl(id, ".libs"));
+
+        // test double load
+        BOOST_CHECK(ffactory.add_creator_dl(id, ".libs"));
+                
         yp2::filter::Base* filter = 0;
         filter = ffactory.create(id);
 
@@ -112,6 +116,7 @@ BOOST_AUTO_UNIT_TEST( test_filter_factory_2 )
     }
 }
 #endif
+#endif
 
 /*
  * Local variables: