From b9f8b7c9c936ce864e06e25f67c19442d71fde75 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 29 Dec 2021 15:44:51 +0100 Subject: [PATCH] Fix error in deepCopy of MEDFileJoints for ASTERXX splitter --- src/MEDLoader/MEDFileJoint.cxx | 2 +- src/MEDLoader/Swig/MEDLoaderTest3.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 ?") -- 2.39.2