From: ageay Date: Wed, 13 Feb 2013 16:58:21 +0000 (+0000) Subject: Protect against throw in MEDFileMesh::New(arg0,arg1) X-Git-Tag: V6_main_FINAL~359 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c1c41c08a483d4113cf19f7b174472a25fa059de;p=tools%2Fmedcoupling.git Protect against throw in MEDFileMesh::New(arg0,arg1) --- diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 84736406e..84ff804d8 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -338,7 +338,7 @@ namespace ParaMEDMEM { public: static MEDFileMesh *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1); + static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception); virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); virtual void clearNonDiscrAttributes() const; @@ -358,8 +358,8 @@ namespace ParaMEDMEM void setTimeUnit(const char *unit); const char *getTimeUnit() const; virtual int getNumberOfNodes() const throw(INTERP_KERNEL::Exception); - std::vector getNonEmptyLevels() const; - std::vector getNonEmptyLevelsExt() const; + std::vector getNonEmptyLevels() const throw(INTERP_KERNEL::Exception); + std::vector getNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); int getSizeAtLevel(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception); // @@ -428,7 +428,7 @@ namespace ParaMEDMEM return MEDFileMesh::New(fileName); } - MEDFileMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) + MEDFileMesh(const char *fileName, const char *mName, int dt=-1, int it=-1) throw(INTERP_KERNEL::Exception) { return MEDFileMesh::New(fileName,mName,dt,it); } diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 3f66653fd..6034a8dc4 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -29,6 +29,7 @@ class MEDLoaderTest(unittest.TestCase): fileName="Pyfile18.med" mname="ExampleOfMultiDimW" medmesh=MEDFileMesh.New(fileName,mname) + self.assertRaises(InterpKernelException,MEDFileMesh.New,fileName,"") self.assertEqual((0,-1),medmesh.getNonEmptyLevels()) m1_0=medmesh.getLevel0Mesh(True) m1_1=MEDLoader.ReadUMeshFromFile(fileName,mname,0)