]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
23403: [CEA 1993] test MEDCouplingBasicsTest4.py : call with bad type argument
authoreap <eap@opencascade.com>
Wed, 14 Dec 2016 16:38:23 +0000 (19:38 +0300)
committereap <eap@opencascade.com>
Wed, 14 Dec 2016 16:38:23 +0000 (19:38 +0300)
   Porting to swig-3

src/MEDCoupling_Swig/MEDCouplingMemArray.i
src/MEDLoader/Swig/MEDLoaderTest3.py

index 2424e9821ddc9a7e9f3515c8ba8f3ab7ceba1786..24c6274855f9cdd553e2ce4c1a860a2cdbc9e01c 100644 (file)
@@ -2933,14 +2933,14 @@ namespace MEDCoupling
         const char *msg="MEDCoupling::DataArrayInt::setValues : Available API are : \n-DataArrayInt.setValues([1,3,4])\n-DataArrayInt.setValues([1,3,4],3)\n-DataArrayInt.setValues([1,3,4,5],2,2)\n-DataArrayInt.New(5)\n !";
         if(PyList_Check(li) || PyTuple_Check(li))
           {
-            if(nbOfTuples)
+            if(nbOfTuples && nbOfTuples != Py_None)
               {
                 if(PyInt_Check(nbOfTuples))
                   {
                     int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
                     if(nbOfTuples<0)
                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
-                    if(nbOfComp)
+                    if(nbOfComp && nbOfComp != Py_None)
                       {
                         if(PyInt_Check(nbOfComp))
                           {//DataArrayInt.setValues([1,3,4,5],2,2)
index 9dbc004f97d5417b1f676d5ce99ce768e58579dc..f84a7cfcd9da4dc243ffa82527fe2c3754ef3b95 100644 (file)
@@ -3903,7 +3903,7 @@ class MEDLoaderTest3(unittest.TestCase):
         arr[:,0]=range(25)
         arr[:,1]=range(100,125)
         f.setArray(arr)
-        WriteField(fileName,f,2)
+        WriteField(fileName,f,True)
         f=MEDCouplingFieldDouble(ON_NODES,ONE_TIME) ; f.setMesh(m)
         f.setName("FieldNode")
         arr=DataArrayDouble(36,2) ; arr.setInfoOnComponents(compos)
@@ -3968,7 +3968,7 @@ class MEDLoaderTest3(unittest.TestCase):
         arr[:,0]=range(25)
         arr[:,1]=range(100,125)
         f.setArray(arr)
-        WriteField(fileName,f,2)
+        WriteField(fileName,f,True)
         f=MEDCouplingFieldDouble(ON_NODES,ONE_TIME) ; f.setMesh(m)
         f.setName("FieldNode")
         arr=DataArrayDouble(36,2) ; arr.setInfoOnComponents(compos)