Salome HOME
Use pyobj type in optimizer loop.
[modules/yacs.git] / src / yacsloader / Test / YacsLoaderTest.cxx
index fc76e21ca6f643cf94e5a865994a3331da0e20be..83a5413a5baa3c418e866f3928cf86157433b7c6 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2006-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #include "yacsconfig.h"
 #include "RuntimeSALOME.hxx"
 #include "PythonPorts.hxx"
 
 #include <iostream>
 #include <fstream>
+#include <stdlib.h>
+#ifdef WIN32
+#include <io.h>
+#define F_OK 0
+#define access _access
+#else
+#include <unistd.h>
+#endif
 
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
@@ -26,16 +53,20 @@ int driverTest(Proc* &p, const char* schema)
 
   YACSLoader loader;
   Executor executor;
-  
   try
     {
       p=loader.load(schema);
+        
+      std::cerr << __FILE__ << std::endl;
       DEBTRACE("Proc *p = " << p);
       std::ofstream f("toto");
       p->writeDot(f);
       f.close();
       DEBTRACE("+++++++++++++++++++ BEGIN execution " << schema);
+      std::cerr << __FILE__ << std::endl;    
       executor.RunW(p,0);
+      std::cerr << __FILE__ << std::endl;
+
       DEBTRACE("+++++++++++++++++++   END execution " << schema);
       std::ofstream g("titi");
       p->writeDot(g);
@@ -46,13 +77,20 @@ int driverTest(Proc* &p, const char* schema)
   catch (YACS::Exception& e)
     {
       DEBTRACE("YACS exception caught: ");
+        std::cerr << __FILE__ << std::endl;
       DEBTRACE(e.what());
+        std::cerr << __FILE__ << std::endl;
+
       DEBTRACE("+++++++++++++++++++ END test in error " << schema);
       return 1;
     }
   catch (const std::ios_base::failure&)
     {
+        std::cerr << __FILE__ << std::endl;
+
       DEBTRACE("io failure");
+  std::cerr << __FILE__ << std::endl;
+
       DEBTRACE("+++++++++++++++++++ END test in error " << schema);
       return 1;
     }
@@ -65,10 +103,13 @@ int driverTest(Proc* &p, const char* schema)
       const char *p = tc->name();
       if ( *p != '\0' )
         {
+            std::cerr << __FILE__ << std::endl;
+
           DEBTRACE(p);
         }
       else
         {
+  std::cerr << __FILE__ << std::endl;
           DEBTRACE(tc->id());
         }
       DEBTRACE("+++++++++++++++++++ END test in error " << schema);
@@ -108,7 +149,7 @@ void YacsLoaderTest::aschema()
   if (p)
     {
       CORBA::Double dval = 0;
-      char *text = "";
+      char *text = (char*)"";
       CPPUNIT_ASSERT(p->nodeMap["c0.c1.n1"]);
       *((OutputCorbaPort*)p->nodeMap["c0.c1.n1"]->getOutputPort("p1"))->getAny() >>= dval;
       PyObject *data = ((OutputPyPort*)p->nodeMap["node32"]->getOutputPort("p1"))->get();
@@ -148,13 +189,21 @@ void YacsLoaderTest::cschema()
 #ifdef SALOME_KERNEL
   if (p)
     {
-      CORBA::Double dval = 0;
-      const char *text = "";
-      *((OutputCorbaPort*)p->nodeMap["node1"]->getOutputPort("p1"))->getAny() >>= text;
-      CPPUNIT_ASSERT_EQUAL(string("Hello coucou!"), string(text) );
-      text = "";
-      *((OutputCorbaPort*)p->nodeMap["node2"]->getOutputPort("p1"))->getAny() >>= text;
-      CPPUNIT_ASSERT_EQUAL(string("Hello Hello coucou!!"), string(text) );
+      if(getenv("PYHELLO_ROOT_DIR"))
+        {
+          std::string hellodir(getenv("PYHELLO_ROOT_DIR"));
+          hellodir=hellodir+"/share/salome/resources/pyhello";
+          if(access(hellodir.c_str(),F_OK) == 0)
+            {
+              CORBA::Double dval = 0;
+              const char *text = "";
+              *((OutputCorbaPort*)p->nodeMap["node1"]->getOutputPort("p1"))->getAny() >>= text;
+              CPPUNIT_ASSERT_EQUAL(string("Hello coucou!"), string(text) );
+              text = "";
+              *((OutputCorbaPort*)p->nodeMap["node2"]->getOutputPort("p1"))->getAny() >>= text;
+              CPPUNIT_ASSERT_EQUAL(string("Hello Hello coucou!!"), string(text) );
+            }
+        }
       delete p;
     }
 #endif
@@ -170,16 +219,24 @@ void YacsLoaderTest::dschema()
 #ifdef SALOME_KERNEL
   if (p)
     {
-      CORBA::Double dval = 0;
-      const char *text = "";
-      *((OutputCorbaPort*)p->nodeMap["node1"]->getOutputPort("p1"))->getAny() >>= text;
-      CPPUNIT_ASSERT_EQUAL(string("Hello coucou!"), string(text) );
-      text = "";
-      *((OutputCorbaPort*)p->nodeMap["node2"]->getOutputPort("p1"))->getAny() >>= text;
-      CPPUNIT_ASSERT_EQUAL(string("Hello Hello coucou!!"), string(text) );
-      text = "";
-      *((OutputCorbaPort*)p->nodeMap["node3"]->getOutputPort("p1"))->getAny() >>= text;
-      CPPUNIT_ASSERT_EQUAL( string("Hello Hello coucou!!"), string(text));
+      if(getenv("PYHELLO_ROOT_DIR"))
+        {
+          std::string hellodir(getenv("PYHELLO_ROOT_DIR"));
+          hellodir=hellodir+"/share/salome/resources/pyhello";
+          if(access(hellodir.c_str(),F_OK) == 0)
+            {
+              CORBA::Double dval = 0;
+              const char *text = "";
+              *((OutputCorbaPort*)p->nodeMap["node1"]->getOutputPort("p1"))->getAny() >>= text;
+              CPPUNIT_ASSERT_EQUAL(string("Hello coucou!"), string(text) );
+              text = "";
+              *((OutputCorbaPort*)p->nodeMap["node2"]->getOutputPort("p1"))->getAny() >>= text;
+              CPPUNIT_ASSERT_EQUAL(string("Hello Hello coucou!!"), string(text) );
+              text = "";
+              *((OutputCorbaPort*)p->nodeMap["node3"]->getOutputPort("p1"))->getAny() >>= text;
+              CPPUNIT_ASSERT_EQUAL( string("Hello Hello coucou!!"), string(text));
+            }
+        }
       delete p;
     }
 #endif
@@ -195,7 +252,7 @@ void YacsLoaderTest::eschema()
   if (p)
     {
       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-      char *text = PyString_AsString(data);
+      const char *text = PyUnicode_AsUTF8(data);
       CPPUNIT_ASSERT_EQUAL(string("coucoucoucoucoucoucoucou"), string(text));
       delete p;
     }
@@ -211,7 +268,7 @@ void YacsLoaderTest::fschema()
   if (p)
     {
       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-      char *text = PyString_AsString(data);;
+      const char *text = PyUnicode_AsUTF8(data);
       CPPUNIT_ASSERT_EQUAL(string("coucoucoucoucoucoucoucou"), string(text) );
       delete p;
     }
@@ -283,7 +340,46 @@ void YacsLoaderTest::schema2()
         *((OutputCorbaPort*)p->nodeMap["node63"]->getOutputPort("p1"))->getAny() >>= dval;
         CPPUNIT_ASSERT_DOUBLES_EQUAL(25., dval, 1.E-12);
       }
-      delete p;
+      try
+        {
+          delete p;
+        }
+      catch (YACS::Exception& e)
+        {
+          DEBTRACE("YACS exception caught: ");
+          DEBTRACE(e.what());
+        }
+      catch (const std::ios_base::failure&)
+        {
+          DEBTRACE("io failure");
+        }
+      catch(CORBA::SystemException& ex)
+        {
+          DEBTRACE("Caught a CORBA::SystemException.");
+          CORBA::Any tmp;
+          tmp <<= ex;
+          CORBA::TypeCode_var tc = tmp.type();
+          const char *p = tc->name();
+          if ( *p != '\0' )
+            {
+              DEBTRACE(p);
+            }
+          else
+            {
+              DEBTRACE(tc->id());
+            }
+        }
+      catch(omniORB::fatalException& fe)
+        {
+          DEBTRACE("Caught omniORB::fatalException:" );
+          DEBTRACE("  file: " << fe.file());
+          DEBTRACE("  line: " << fe.line());
+          DEBTRACE("  mesg: " << fe.errmsg());
+        }
+      catch(...)
+        {
+          DEBTRACE("unknown exception");
+        }
     }
 }
 
@@ -321,9 +417,6 @@ void YacsLoaderTest::forloop3()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -337,9 +430,6 @@ void YacsLoaderTest::forloop4()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -353,9 +443,6 @@ void YacsLoaderTest::forloop5()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -369,9 +456,6 @@ void YacsLoaderTest::forloop6()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -386,9 +470,6 @@ void YacsLoaderTest::forloop7()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -402,9 +483,6 @@ void YacsLoaderTest::switch1()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -418,9 +496,6 @@ void YacsLoaderTest::switch2()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -434,9 +509,6 @@ void YacsLoaderTest::switch3()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -450,9 +522,6 @@ void YacsLoaderTest::switch4()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -466,9 +535,6 @@ void YacsLoaderTest::switch5()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -482,9 +548,6 @@ void YacsLoaderTest::switch6()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -498,9 +561,6 @@ void YacsLoaderTest::switch7()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -514,9 +574,6 @@ void YacsLoaderTest::switch8()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -530,9 +587,6 @@ void YacsLoaderTest::switch9()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -546,9 +600,6 @@ void YacsLoaderTest::whiles()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
   ret = driverTest(p, "samples/while2.xml");
@@ -566,9 +617,6 @@ void YacsLoaderTest::forwhile1()
   CPPUNIT_ASSERT(p != 0);
   if (p)
     {
-//       PyObject *data = ((OutputPyPort*)p->nodeMap["node2"]->getOutputPort("p1"))->get();
-//       char *text = PyString_AsString(data);;
-//       CPPUNIT_ASSERT_EQUAL(string(text), string("coucoucoucoucoucoucoucou"));
       delete p;
     }
 }
@@ -599,11 +647,11 @@ void YacsLoaderTest::refcnt()
   ret = driverTest(p, "samples/refcnt1.xml");
   CPPUNIT_ASSERT(ret == 0);
   data = ((OutputPyPort*)p->nodeMap["b1.b.node1"]->getOutputPort("p1"))->get();
-  CPPUNIT_ASSERT_EQUAL(13, data->ob_refcnt);
+  CPPUNIT_ASSERT(data->ob_refcnt==13);
   ret = driverTest(p, "samples/refcnt2.xml");
   CPPUNIT_ASSERT(ret == 0);
   data = ((OutputPyPort*)p->nodeMap["b1.b.node1"]->getOutputPort("p1"))->get();
-  CPPUNIT_ASSERT_EQUAL(19, data->ob_refcnt);
+  CPPUNIT_ASSERT(data->ob_refcnt==19);
 }
 
 void YacsLoaderTest::foreachs()
@@ -611,22 +659,53 @@ void YacsLoaderTest::foreachs()
   Proc *p = 0;
   int ret;
   ret = driverTest(p, "samples/foreach1.xml");
-  CPPUNIT_ASSERT(ret == 0);
-  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach1.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach1.xml", p->getEffectiveState() == YACS::DONE);
+  delete p;
   ret = driverTest(p, "samples/foreach2.xml");
-  CPPUNIT_ASSERT(ret == 0);
-  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach2.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach2.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
   ret = driverTest(p, "samples/foreach3.xml");
-  CPPUNIT_ASSERT(ret == 1);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach3.xml", ret == 1);
+  delete p;
   ret = driverTest(p, "samples/foreach4.xml");
-  CPPUNIT_ASSERT(ret == 0);
-  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach4.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach4.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
   ret = driverTest(p, "samples/foreach5.xml");
-  CPPUNIT_ASSERT(ret == 0);
-  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach5.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach5.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
   ret = driverTest(p, "samples/foreach6.xml");
-  CPPUNIT_ASSERT(ret == 0);
-  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach6.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach6.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
+  ret = driverTest(p, "samples/foreach8.xml");
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach8.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach8.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
+  ret = driverTest(p, "samples/foreach_init2fin.xml");
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach_init2fin.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach_init2fin.xml", p->getEffectiveState() == YACS::DONE );
+  delete p;
+  ret = driverTest(p, "samples/foreach_init2work.xml");
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach_init2work.xml", ret == 0);
+  CPPUNIT_ASSERT_MESSAGE("Schema: foreach_init2work.xml", p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_EQUAL(p->getOutputPort("PostProc.r")->getAsString(), std::string("108"));
+  delete p;
+  if(getenv("GEOM_ROOT_DIR"))
+    {
+      std::string geomdir(getenv("GEOM_ROOT_DIR"));
+      geomdir=geomdir+"/share/salome/resources/geom";
+      if(access(geomdir.c_str(),F_OK) == 0)
+      {
+        ret = driverTest(p, "samples/foreach7.xml"); //needs GEOM_Superv component
+        CPPUNIT_ASSERT_MESSAGE("Schema: foreach7.xml", ret == 0);
+        CPPUNIT_ASSERT_MESSAGE("Schema: foreach7.xml", p->getEffectiveState() == YACS::DONE );
+        delete p;
+      }
+    }
 }
 
 void YacsLoaderTest::sinlines()
@@ -697,6 +776,12 @@ void YacsLoaderTest::structs()
   ret = driverTest(p, "samples/struct1.xml");
   CPPUNIT_ASSERT(ret == 0);
   CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/struct2.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
 }
 
 void YacsLoaderTest::cpps()
@@ -708,3 +793,93 @@ void YacsLoaderTest::cpps()
   CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
   delete p;
 }
+
+void YacsLoaderTest::datanodes()
+{
+  Proc *p = 0;
+  int ret;
+  ret = driverTest(p, "samples/datanode0.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+}
+
+void YacsLoaderTest::optimizers()
+{
+  Proc *p = 0;
+  int ret;
+  ret = driverTest(p, "samples/optimizer1.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer2.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_sync_cpp.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_async_cpp.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_sync_py.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_async_py.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_retro.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/double_optimizer_py.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+  ret = driverTest(p, "samples/optimizer_pyobj.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  delete p;
+
+}
+
+void YacsLoaderTest::pyremotes()
+{
+  Proc *p = 0;
+  int ret;
+  ret = driverTest(p, "samples/pyremote1.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  ret = driverTest(p, "samples/pyremote2.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  ret = driverTest(p, "samples/pyremote3.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  ret = driverTest(p, "samples/pyremote4.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+}
+
+void YacsLoaderTest::nonepyobj()
+{
+  Proc *p = 0;
+  int ret;
+  ret = driverTest(p, "samples/nonepyobj.xml");
+  CPPUNIT_ASSERT(ret == 0);
+  CPPUNIT_ASSERT(p->getEffectiveState() == YACS::DONE );
+  CPPUNIT_ASSERT_EQUAL(p->getOutputPort("n2.r")->getAsString(), std::string("True"));
+  delete p;
+}