From: Anthony Geay Date: Wed, 29 Dec 2021 14:44:51 +0000 (+0100) Subject: Fix error in deepCopy of MEDFileJoints for ASTERXX splitter X-Git-Tag: V9_9_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b9f8b7c9c936ce864e06e25f67c19442d71fde75;p=tools%2Fmedcoupling.git Fix error in deepCopy of MEDFileJoints for ASTERXX splitter --- diff --git a/src/MEDLoader/MEDFileJoint.cxx b/src/MEDLoader/MEDFileJoint.cxx index 10d7d16a6..fc84eaf0b 100644 --- a/src/MEDLoader/MEDFileJoint.cxx +++ b/src/MEDLoader/MEDFileJoint.cxx @@ -581,7 +581,7 @@ MEDFileJoint *MEDFileJoint::deepCopy() const for(std::vector< MCAuto >::const_iterator it=_joint.begin();it!=_joint.end();it++,i++) if((const MEDFileJointOneStep *)*it) joint[i]=(*it)->deepCopy(); - MCAuto ret=MEDFileJoint::New(); + MCAuto ret=new MEDFileJoint(*this); ret->_joint=joint; return ret.retn(); } diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index d0d9960ec..8e09b12f2 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -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 ?")