From: ageay Date: Wed, 20 Apr 2011 17:14:33 +0000 (+0000) Subject: Bug in swiging. X-Git-Tag: EndWorkDidier~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f9ea1e97d4082b81e586e448cd2afe20067f7207;p=tools%2Fmedcoupling.git Bug in swiging. --- diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index f2d9e495a..08a975ca1 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -1318,7 +1318,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -1347,7 +1347,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -1376,7 +1376,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -1405,7 +1405,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -1434,7 +1434,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -2419,7 +2419,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -2448,7 +2448,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -2477,7 +2477,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -2506,7 +2506,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); @@ -2535,7 +2535,7 @@ namespace ParaMEDMEM if(!da2) throw INTERP_KERNEL::Exception("Not null DataArrayInt instance expected !"); da2->checkAllocated(); - int size=self->getNbOfElems(); + int size=self->getNumberOfTuples(); if(size!=self->getNumberOfTuples()) { throw INTERP_KERNEL::Exception("Invalid list length ! Must be equal to number of tuples !"); diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 8873fef74..d21a57e05 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -5896,6 +5896,15 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertEqual(expected1,b.getValues()) pass + def testSwigErrorRenum(self): + da=DataArrayDouble.New() + da.setValues([7.,107.,8.,108.,9.,109.,10.,110.,11.,111.,12.,112.,13.,113.,14.,114.,15.,115.,16.,116.],10,2) + d=DataArrayInt.New() + d.setValues([0,2,3,1,4,5,6,8,7,9],10,1) + da.renumberInPlace(d) + da.renumber(d) + pass + def testSwigGetItem1(self): da=DataArrayInt.New() da.alloc(16,3)