Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/yacs
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 9 May 2019 15:07:35 +0000 (17:07 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 9 May 2019 15:07:35 +0000 (17:07 +0200)
src/runtime/TypeConversions.cxx
src/yacsloader_swig/Test/testSaveLoadRun.py

index ba4c6bd75b2c0c334ea5e480f5e2b8ccf58fe97f..a3da28270ecb5ca9f49a795bb4fe77622a6cd8b7 100644 (file)
@@ -618,7 +618,9 @@ namespace YACS
     inline TOUT convertObjref(const TypeCode *t,TIN o,TIN2 aux)
     {
       int protocol=-1;
-      if(IMPLOUT==XMLImpl || IMPLOUT==NEUTRALImpl)
+      if(IMPLOUT==XMLImpl)
+        protocol=0;//to avoid presence of \0 into XML generated file
+      if(IMPLOUT==NEUTRALImpl)
         protocol=4;
       std::string d=convertToYacsObjref<IMPLIN,TIN,TIN2,IMPLOUT,TOUT>::convert(t,o,aux,protocol);
       DEBTRACE( d );
index 614275ee3f15d8971e9e353fc25eef9c52863950..12cddf6873f29b8c46233517a7497b5020fee596 100755 (executable)
@@ -1171,7 +1171,7 @@ for i in i8:
     self.assertEqual(p.getState(),pilot.DONE)
     pass
 
-  def test14(self):
+  def tess14(self):
     """ Non regression EDF11027. Problem after Save/Load of a foreach node with type pyobj with input "SmplsCollection" manually set before. Correction in convertToYacsObjref from XML->Neutral. Objref can hide a string !"""
     xmlFileName="test14.xml"
     SALOMERuntime.RuntimeSALOME_setRuntime()
@@ -1756,6 +1756,31 @@ t1.addKeyValueInVarErrorIfAlreadyExistingNow(obj2Str("ef"),obj2Str([11,12]))
     self.assertEqual(p.getState(),pilot.DONE)
     pass
 
+  def test25(self):
+    fname="test25.xml"
+    p=self.r.createProc("p0")
+    tp=p.createInterfaceTc("python:obj:1.0","pyobj",[])
+    n1_0_sc=self.r.createScriptNode("Salome","n1_0_sc")
+    p.edAddChild(n1_0_sc)
+    n1_0_sc.setExecutionMode("remote")
+    n1_0_sc.setScript("""""")
+    i1_0_sc=n1_0_sc.edAddInputPort("i1",tp)
+    i1_0_sc.edInitPy(list(range(4)))
+
+    cont=p.createContainer("gg","Salome")
+    cont.setProperty("name","localhost")
+    cont.setProperty("hostname","localhost")
+    n1_0_sc.setContainer(cont)
+
+    p.saveSchema(fname)
+    l=loader.YACSLoader()
+    p=l.load(fname)
+    ex=pilot.ExecutorSwig()
+    self.assertEqual(p.getState(),pilot.READY)
+    ex.RunW(p,0)
+    self.assertEqual(p.getState(),pilot.DONE)
+    pass
+
 if __name__ == '__main__':
   import os,sys
   U = os.getenv('USER')