Salome HOME
Optimize usage of context for PythonNode (by deleting input and output port PyObject...
[modules/yacs.git] / src / yacsloader / Test / YacsLoaderTest.cxx
index 0f1e8513877dd9e8435203aa93cf426f88e228cb..109145e8acee9f2458332a787080141c15836844 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2022  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -70,6 +70,7 @@ int driverTest(Proc* &p, const char* schema)
       DEBTRACE("+++++++++++++++++++   END execution " << schema);
       std::ofstream g("titi");
       p->writeDot(g);
+      p->shutdown(10);
       g.close();
       DEBTRACE("+++++++++++++++++++ END test " << schema);
       return 0;
@@ -204,6 +205,7 @@ void YacsLoaderTest::cschema()
               CPPUNIT_ASSERT_EQUAL(string("Hello Hello coucou!!"), string(text) );
             }
         }
+      p->shutdown(10);
       delete p;
     }
 #endif
@@ -237,6 +239,7 @@ void YacsLoaderTest::dschema()
               CPPUNIT_ASSERT_EQUAL( string("Hello Hello coucou!!"), string(text));
             }
         }
+      p->shutdown(10);
       delete p;
     }
 #endif
@@ -651,7 +654,7 @@ void YacsLoaderTest::refcnt()
   ret = driverTest(p, "samples/refcnt2.xml");
   CPPUNIT_ASSERT(ret == 0);
   data = ((OutputPyPort*)p->nodeMap["b1.b.node1"]->getOutputPort("p1"))->get();
-  CPPUNIT_ASSERT(data->ob_refcnt==19);
+  CPPUNIT_ASSERT_EQUAL(data->ob_refcnt,(long int)13);
 }
 
 void YacsLoaderTest::foreachs()
@@ -667,6 +670,7 @@ void YacsLoaderTest::foreachs()
   CPPUNIT_ASSERT_MESSAGE("Schema: foreach2.xml", p->getEffectiveState() == YACS::DONE );
   delete p;
   ret = driverTest(p, "samples/foreach3.xml");
+  p->shutdown(10);
   CPPUNIT_ASSERT_MESSAGE("Schema: foreach3.xml", ret == 1);
   delete p;
   ret = driverTest(p, "samples/foreach4.xml");
@@ -684,6 +688,7 @@ void YacsLoaderTest::foreachs()
   ret = driverTest(p, "samples/foreach8.xml");
   CPPUNIT_ASSERT_MESSAGE("Schema: foreach8.xml", ret == 0);
   CPPUNIT_ASSERT_MESSAGE("Schema: foreach8.xml", p->getEffectiveState() == YACS::DONE );
+  p->shutdown(10);
   delete p;
   ret = driverTest(p, "samples/foreach_init2fin.xml");
   CPPUNIT_ASSERT_MESSAGE("Schema: foreach_init2fin.xml", ret == 0);