]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Fix error in deepCopy of MEDFileJoints for ASTERXX splitter
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Dec 2021 14:44:51 +0000 (15:44 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 29 Dec 2021 14:44:51 +0000 (15:44 +0100)
src/MEDLoader/MEDFileJoint.cxx
src/MEDLoader/Swig/MEDLoaderTest3.py

index 10d7d16a6b9b3f2ab34e1dc00cc3a3244acf90da..fc84eaf0b1725661602e2fbddca214b53e2bd94d 100644 (file)
@@ -581,7 +581,7 @@ MEDFileJoint *MEDFileJoint::deepCopy() const
   for(std::vector< MCAuto<MEDFileJointOneStep> >::const_iterator it=_joint.begin();it!=_joint.end();it++,i++)
     if((const MEDFileJointOneStep *)*it)
       joint[i]=(*it)->deepCopy();
-  MCAuto<MEDFileJoint> ret=MEDFileJoint::New();
+  MCAuto<MEDFileJoint> ret=new MEDFileJoint(*this);
   ret->_joint=joint;
   return ret.retn();
 }
index d0d9960eccb819ebd113abf3cbee401d1a885ff0..8e09b12f2a7c4935fc479f9e04b709e3c1a6432a 100644 (file)
@@ -5004,6 +5004,12 @@ class MEDLoaderTest3(unittest.TestCase):
         self.assertEqual( "joint_description", one_joint.getDescription())
         self.assertEqual( 1, one_joint.getDomainNumber())
         self.assertEqual( "joint_1", one_joint.getJointName())
+        one_joint_copy = one_joint.deepCopy()
+        self.assertEqual( "maa1", one_joint_copy.getLocalMeshName())
+        self.assertEqual( "maa2", one_joint_copy.getRemoteMeshName())
+        self.assertEqual( "joint_description", one_joint_copy.getDescription())
+        self.assertEqual( 1, one_joint_copy.getDomainNumber())
+        self.assertEqual( "joint_1", one_joint_copy.getJointName())
         pass
 
     @unittest.skipUnless('linux'==platform.system().lower(),"stderr redirection not ported on Windows ?")