# -*- coding: utf-8 -*-
-# Copyright (C) 2007-2015 CEA/DEN, EDF R&D
+# Copyright (C) 2007-2016 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.assertTrue(not ((dbl.reprZip().find("Number of components : 1"))==-1));
self.assertRaises(InterpKernelException, dbl.selectByTupleIdSafeSlice, 0, 1, -1);
- self.assertRaises(InterpKernelException, dbl.substr, -1, 1);
- self.assertRaises(InterpKernelException, dbl.substr, 8, 1);
- self.assertRaises(InterpKernelException, dbl.substr, 0, 8);
+ self.assertRaises(InterpKernelException, dbl.subArray, -1, 1);
+ self.assertRaises(InterpKernelException, dbl.subArray, 8, 1);
+ self.assertRaises(InterpKernelException, dbl.subArray, 0, 8);
self.assertRaises(InterpKernelException, dbl.meldWith, dd);
self.assertRaises(InterpKernelException, dbl.setPartOfValuesAdv, dbl2, da); #dbl dbl2 not have the same number of components
da2.setIJ(1,0,1.+1.e-11);
self.assertTrue(not da2.isUniform(1.,1.e-12));
pass
+
+ def testDAHasUniqueValues1(self):
+ da=DataArrayInt([1,2,3,4,5])
+ self.assertTrue(da.hasUniqueValues())
+ da[1,0] = 5
+ self.assertFalse(da.hasUniqueValues())
+ da=DataArrayInt([])
+ self.assertTrue(da.hasUniqueValues())
+ da=DataArrayInt([(1,2), (2,3)]) # wrong num of compo
+ self.assertRaises(InterpKernelException, da.hasUniqueValues)
+ da=DataArrayInt() # non allocated array
+ self.assertRaises(InterpKernelException, da.hasUniqueValues)
+ pass
def testDADFromPolarToCart1(self):
tab1=[2.,0.2,2.5,0.7]