From d0fbe5dfe66722c5443e017113170446e19e977d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 14 Dec 2016 19:38:23 +0300 Subject: [PATCH] 23403: [CEA 1993] test MEDCouplingBasicsTest4.py : call with bad type argument Porting to swig-3 --- src/MEDCoupling_Swig/MEDCouplingMemArray.i | 4 ++-- src/MEDLoader/Swig/MEDLoaderTest3.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingMemArray.i b/src/MEDCoupling_Swig/MEDCouplingMemArray.i index 2424e9821..24c627485 100644 --- a/src/MEDCoupling_Swig/MEDCouplingMemArray.i +++ b/src/MEDCoupling_Swig/MEDCouplingMemArray.i @@ -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) diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 9dbc004f9..f84a7cfcd 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -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) -- 2.39.2