1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MEDMEMTest.hxx"
21 #include <cppunit/Message.h>
22 #include <cppunit/TestAssert.h>
24 #include "MEDMEM_nArray.hxx"
25 #include "MEDMEM_define.hxx"
26 #include "MEDMEM_ArrayConvert.hxx"
31 // use this define to enable lines, execution of which leads to Segmentation Fault
32 //#define ENABLE_FAULTS
34 // use this define to enable CPPUNIT asserts and fails, showing bugs
35 //#define ENABLE_FORCED_FAILURES
38 using namespace MEDMEM;
39 using namespace MED_EN;
42 * Check methods (21), defined in MEDMEM_nArray.hxx:
43 * class MEDMEM_Array_ {
44 * (-) virtual bool getGaussPresence() const { return false; }
45 * (-) virtual MED_EN::medModeSwitch getInterlacingType() const {return MED_EN::MED_UNDEFINED_INTERLACE;}
46 * (+) ~MEDMEM_Array_() {};
48 * template<class ARRAY_ELEMENT_TYPE,
49 * class INTERLACING_POLICY=FullInterlaceNoGaussPolicy,
50 * class CHECKING_POLICY=IndexCheckPolicy>
51 * class MEDMEM_Array : public INTERLACING_POLICY, public CHECKING_POLICY, public MEDMEM_Array_ {
53 * (+) ~MEDMEM_Array();
54 * (+) inline MEDMEM_Array(int dim, int nbelem);
55 * (+) inline MEDMEM_Array(ElementType * values, int dim, int nbelem,
56 * bool shallowCopy=false, bool ownershipOfValues=false);
57 * (+) inline MEDMEM_Array(int dim, int nbelem, int nbtypegeo,
58 * const int * const nbelgeoc, const int * const nbgaussgeo);
59 * (+) inline MEDMEM_Array(ElementType * values, int dim, int nbelem, int nbtypegeo,
60 * const int * const nbelgeoc, const int * const nbgaussgeo,
61 * bool shallowCopy=false, bool ownershipOfValues=false);
62 * (+) inline MEDMEM_Array(const MEDMEM_Array & array, bool shallowCopy=false);
63 * (+) inline MEDMEM_Array<ElementType,InterlacingPolicy,CheckingPolicy> &
64 * operator=(const MEDMEM_Array & array);
65 * (+) MED_EN::medModeSwitch getInterlacingType() const;
66 * (+) bool getGaussPresence() const;
67 * (+) ElementType * getPtr();
68 * (+) void setPtr(ElementType * values, bool shallowCopy=false, bool ownershipOfValues=false);
69 * (+) inline const ElementType * getRow(int i) const;
70 * (+) void setRow(int i,const ElementType * const value);
71 * (+) inline const ElementType * getColumn(int j) const;
72 * (+) void setColumn(int j, const ElementType * const value);
73 * (+) inline const ElementType & getIJ(int i, int j) const;
74 * (+) inline const ElementType & getIJK(int i, int j, int k) const;
75 * (+) inline void setIJ(int i, int j, const ElementType & value);
76 * (+) inline void setIJK(int i, int j, int k, const ElementType & value);
77 * (+) bool operator == (const MEDMEM_Array & array) const;
78 * (+) friend ostream & operator<<(ostream & os, const MEDMEM_Array & array);
81 void MEDMEMTest::testnArray()
84 const int nbelem1 = 20;
85 const double EPS = 0.00001;
87 /////////////////////////////////////////
88 // TEST 1 FullInterlace et NoGauss //
89 ////////////////////////////////////////
90 const double * myArray1Ptr = 0;
91 const double array1Ref[] = { 11 , 12 , 21 , 22 , 31 , 32 , 41 , 42 , 51 , 52 ,
92 61 , 62 , 71 , 72 , 81 , 82 , 91 , 92 , 101 , 102 ,
93 111 , 112 , 121 , 122 , 131 , 132 , 141 , 142 ,
94 151 , 152 , 161 , 162 , 171 , 172 , 181 , 182 ,
95 191 , 192 , 201 , 202 };
97 const double array2Ref[] = { 11 , 21 , 31 , 41 , 51 , 61 , 71 , 81 , 91 , 101
98 , 111 , 121 , 131 , 141 , 151 , 161 , 171 , 181
100 12 , 22 , 32 , 42 , 52 , 62 , 72 , 82 , 92 , 102
101 , 112 , 122 , 132 , 142 , 152 , 162 , 172 , 182
104 //test MEDMEM_Array(int dim, int nbelem)
105 MEDMEM_Array<double> myArray1(mdim,nbelem1);
106 //test getGaussPresence
107 CPPUNIT_ASSERT( !myArray1.getGaussPresence());
109 //test setIJ. Fill array
110 for (int i =1; i <= nbelem1; i++)
111 for (int j =1; j <= mdim; j++)
113 CPPUNIT_ASSERT_NO_THROW(myArray1.setIJ(i,j,i*10+j));
117 myArray1Ptr = myArray1.getPtr();
118 for (int i = 0; i < mdim*nbelem1; i++)
119 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
122 //test MEDMEM_Array(ElementType * values, int dim, int nbelem, bool shallowCopy=false, bool ownershipOfValues=false)
123 MEDMEM_Array<double> myArray1val ((double*)array1Ref, mdim, nbelem1);
124 myArray1Ptr = myArray1val.getPtr();
125 for (int i = 0; i < mdim*nbelem1; i++)
126 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
128 //test MEDMEM_Array(ElementType * values, int dim, int nbelem, bool shallowCopy=true, bool ownershipOfValues=false);
129 MEDMEM_Array<double> myArray1valsh ((double*)array1Ref, mdim, nbelem1, true);
130 myArray1Ptr = myArray1valsh.getPtr();
131 for (int i = 0; i < mdim*nbelem1; i++)
132 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
135 double myPtr[10] = {-1, -2, -3, -4, -5, -6, -7, -8, -9, 0};
136 CPPUNIT_ASSERT_NO_THROW(myArray1valsh.setPtr(myPtr));
137 //size the array stays the same, only first 10 element are being overwritten
138 myArray1Ptr = myArray1valsh.getPtr();
139 for (int i = 0; i < 10; i++)
140 CPPUNIT_ASSERT_DOUBLES_EQUAL(myArray1Ptr[i], myPtr[i], EPS);
143 //test MEDMEM_Array(ElementType * values, int dim, int nbelem, bool shallowCopy=true, bool ownershipOfValues=true);
145 double * array1Ref_do_not_delete = new double[40];
146 for (int i = 0; i < 40; i = i + 2) {
147 array1Ref_do_not_delete[i ] = 10.0 * (i+1) + 1;
148 array1Ref_do_not_delete[i+1] = 10.0 * (i+1) + 2;
150 MEDMEM_Array<double> myArray1valow (array1Ref_do_not_delete, mdim, nbelem1, true, true);
153 //test MEDMEM_Array(const MEDMEM_Array & array, bool shallowCopy=false)
154 MEDMEM_Array<double> myArray1bis (myArray1, false);
155 CPPUNIT_ASSERT(myArray1 == myArray1bis);
157 myArray1Ptr = myArray1bis.getPtr();
158 for (int i =0; i < mdim*nbelem1; i++)
159 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
161 //test MEDMEM_Array()
162 MEDMEM_Array<double> myArray1ter;
165 myArray1ter = myArray1;
166 myArray1Ptr = myArray1ter.getPtr();
168 catch ( const std::exception &e )
170 CPPUNIT_FAIL(e.what());
174 CPPUNIT_FAIL("Unknown exception");
177 for (int i =0; i < mdim*nbelem1; i++)
178 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
180 MEDMEM_Array<double> myArray1qua(mdim,nbelem1);
181 myArray1Ptr = myArray1qua.getPtr();
183 for (int i =1; i <= nbelem1; i++)
186 //test setRow(int i,const ElementType * const value)
187 myArray1qua.setRow(i,&array1Ref[(i-1)*mdim]);
189 catch (MEDMEM::MEDEXCEPTION &m) {
190 CPPUNIT_FAIL(m.what());
194 CPPUNIT_FAIL("Unknown exception");
198 for (int i =0; i < mdim*nbelem1; i++)
199 CPPUNIT_ASSERT( myArray1Ptr[i] == array1Ref[i] );
201 //test getColumn(int j)
202 CPPUNIT_ASSERT_THROW(myArray1qua.getColumn(1), MEDEXCEPTION);
204 MEDMEM_Array<double,NoInterlaceNoGaussPolicy> * myArray1cin = ArrayConvert(myArray1);
205 myArray1Ptr = myArray1cin->getPtr();
207 for (int j=1; j <= mdim; j++)
208 for (int i=1; i <= nbelem1 ; i++ ) {
209 CPPUNIT_ASSERT( myArray1cin->getIJ(i,j) == array2Ref[elemno] );
210 CPPUNIT_ASSERT( myArray1Ptr[elemno] == array2Ref[elemno] );
214 /////////////////////////////////////
215 // TEST 2 NoInterlace et NoGauss //
216 /////////////////////////////////////
218 const double * myArray2Ptr = 0;
219 //MEDMEM_Array(int dim, int nbelem)
220 MEDMEM_Array<double,NoInterlaceNoGaussPolicy> myArray2(mdim,nbelem1);
222 for (int i =1; i <= nbelem1; i++) {
223 for (int j =1; j <= mdim; j++) {
224 //test setIJ(int i, int j, const ElementType & value)
225 CPPUNIT_ASSERT_NO_THROW(myArray2.setIJ(i,j,i*10+j));
230 myArray2Ptr = myArray2.getPtr();
231 for (int i =0; i < mdim*nbelem1; i++)
232 CPPUNIT_ASSERT( myArray2Ptr[i] == array2Ref[i] );
234 //test MEDMEM_Array(const MEDMEM_Array & array, bool shallowCopy=false)
235 MEDMEM_Array<double,NoInterlaceNoGaussPolicy> myArray2bis(myArray2, false);
236 myArray2Ptr = myArray2bis.getPtr();
237 for (int i =0; i < mdim*nbelem1; i++)
238 CPPUNIT_ASSERT( myArray2Ptr[i] == array2Ref[i] );
240 //test MEDMEM_Array()
241 MEDMEM_Array<double,NoInterlaceNoGaussPolicy> myArray2ter;
242 //test operator=(const MEDMEM_Array & array)
243 myArray2ter = myArray2;
245 myArray2Ptr = myArray2ter.getPtr();
246 for (int i =0; i < mdim*nbelem1; i++)
247 CPPUNIT_ASSERT( myArray2Ptr[i] == array2Ref[i] );
249 MEDMEM_Array<double,NoInterlaceNoGaussPolicy> myArray2qua(mdim,nbelem1);
250 myArray2Ptr = myArray2qua.getPtr();
252 for (int j = 1; j <= mdim; j++) {
253 //test setColumn(int j, const ElementType * const value)
254 CPPUNIT_ASSERT_NO_THROW(myArray2qua.setColumn(j,&array2Ref[nbelem1*(j-1)]));
257 for (int i =0; i < mdim*nbelem1; i++)
258 CPPUNIT_ASSERT( myArray2Ptr[i] == array2Ref[i] );
261 CPPUNIT_ASSERT_THROW(myArray2qua.getRow(1), MEDEXCEPTION);
263 MEDMEM_Array<double,FullInterlaceNoGaussPolicy> * myArray2cin = ArrayConvert(myArray2);
264 myArray2Ptr = myArray2cin->getPtr();
266 for (int i=1; i <= nbelem1 ; i++) {
267 for (int j=1; j <= mdim; j++) {
268 CPPUNIT_ASSERT( myArray2cin->getIJ(i,j) == array1Ref[elemno] );
269 CPPUNIT_ASSERT( myArray2Ptr[elemno] == array1Ref[elemno] );
276 ///////////////////////////////////////
277 // TEST 3 FullInterlace et Gauss //
278 //////////////////////////////////////
279 const int nbelem2 = 5;
280 const int nbtypegeo = 2;
281 const int nbelgeoc[nbtypegeo+1] = {1,3,6};
282 const int nbgaussgeo[nbtypegeo+1] = {-1,2,3};
284 const double * myArray3Ptr = 0;
285 const double array3Ref[] = {1.11 , 1.12 , 1.21 , 1.22 ,
286 2.11 , 2.12 , 2.21 , 2.22 ,
287 13.11 , 13.12 , 13.21 , 13.22 , 13.31 , 13.32 ,
288 14.11 , 14.12 , 14.21 , 14.22 , 14.31 , 14.32 ,
289 15.11 , 15.12 , 15.21 , 15.22 , 15.31 , 15.32 };
291 const double array4Ref[] = { 1.11 , 1.21 , 2.11 , 2.21,
292 13.11 , 13.21 , 13.31 , 14.11 , 14.21 , 14.31 ,
293 15.11 , 15.21 , 15.31 ,
294 1.12 , 1.22 , 2.12 , 2.22 ,
295 13.12 , 13.22 , 13.32 , 14.12 , 14.22 , 14.32 ,
296 15.12 , 15.22 , 15.32 };
298 const int array5Ref[] = { 1 , 1 , 2 , 2,
299 13 , 13 , 13 , 14 , 14 , 14 ,
302 13 , 13 , 13 , 14 , 14 , 14 ,
305 //test MEDMEM_Array(int dim, int nbelem, int nbtypegeo, const int * const nbelgeoc, const int * const nbgaussgeo)
306 MEDMEM_Array<double,FullInterlaceGaussPolicy> myArray3(mdim,nbelem2,nbtypegeo,nbelgeoc,nbgaussgeo);
309 for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
310 for (int i=0; i < (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) ; i++ ) {
311 for (int k=1; k <= nbgaussgeo[ntyp]; k++)
312 for (int j=1; j <= mdim; j++) {
314 //test setIJK(int i, int j, int k, const ElementType & value)
315 myArray3.setIJK(elemno,j,k,elemno+(ntyp-1)*10+0.1*k+0.01*j);
317 catch (MEDMEM::MEDEXCEPTION &m) {
318 CPPUNIT_FAIL(m.what());
322 CPPUNIT_FAIL("Unknown exception");
329 myArray3Ptr = myArray3.getPtr();
330 for (int i =0; i < myArray3.getArraySize(); i++)
331 CPPUNIT_ASSERT_DOUBLES_EQUAL(myArray3Ptr[i], array3Ref[i], EPS);
333 MEDMEM_Array<double,FullInterlaceGaussPolicy> myArray3bis(myArray3, false);
334 myArray3Ptr = myArray3bis.getPtr();
337 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
338 for (int k=1; k <= myArray3bis.getNbGauss(i); k++)
339 for (int j=1; j <= mdim; j++) {
340 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3bis.getIJK(i,j,k), array3Ref[elemno], EPS );
341 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3Ptr[elemno], array3Ref[elemno], EPS );
345 //test MEDMEM_Array()
346 MEDMEM_Array<double,FullInterlaceGaussPolicy> myArray3ter;
347 //test operator=(const MEDMEM_Array & array)
348 myArray3ter = myArray3;
349 myArray3Ptr = myArray3ter.getPtr();
352 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
353 for (int k=1; k <= myArray3ter.getNbGauss(i); k++)
354 for (int j=1; j <= mdim; j++) {
355 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3ter.getIJK(i,j,k), array3Ref[elemno], EPS );
356 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3Ptr[elemno], array3Ref[elemno], EPS );
360 MEDMEM_Array<double,FullInterlaceGaussPolicy> myArray3qua(mdim,nbelem2,
361 nbtypegeo,nbelgeoc,nbgaussgeo);
362 myArray3Ptr = myArray3qua.getPtr();
365 for (int i =1; i <= nbelem2; i++){
367 myArray3qua.setRow(i,&array3Ref[cumul]);
368 cumul+=myArray3qua.getNbGauss(i)*mdim;
370 catch (MEDMEM::MEDEXCEPTION &m) {
371 CPPUNIT_FAIL(m.what());
375 CPPUNIT_FAIL("Unknown exception");
379 for (int i =0; i < myArray3qua.getArraySize(); i++) {
380 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3Ptr[i], array3Ref[i], EPS );
383 MEDMEM_Array<double,NoInterlaceGaussPolicy> * myArray3cin = ArrayConvert(myArray3);
384 myArray3Ptr = myArray3cin->getPtr();
386 for (int j=1; j <= mdim; j++)
387 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
388 for (int k=1; k <= myArray3cin->getNbGauss(i); k++) {
389 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray3cin->getIJK(i,j,k), array4Ref[elemno], EPS );
390 CPPUNIT_ASSERT_DOUBLES_EQUAL(myArray3Ptr[elemno], array4Ref[elemno], EPS );
394 ////////////////////////////////////
395 // TEST 4 NoInterlace et Gauss //
396 ////////////////////////////////////
397 const double * myArray4Ptr = 0;
398 //test MEDMEM_Array(int dim, int nbelem, int nbtypegeo, const int * const nbelgeoc, const int * const nbgaussgeo)
399 MEDMEM_Array<double,NoInterlaceGaussPolicy> myArray4(mdim,nbelem2,nbtypegeo,nbelgeoc,nbgaussgeo);
402 for (int ntyp=1; ntyp <= nbtypegeo; ntyp++ ) {
403 for (int i=0; i < (nbelgeoc[ntyp]-nbelgeoc[ntyp-1]) ; i++ ) {
404 for (int k=1; k <= nbgaussgeo[ntyp]; k++)
405 for (int j=1; j <= mdim; j++) {
407 //test setIJK(int i, int j, int k, const ElementType & value)
408 myArray4.setIJK(elemno,j,k,elemno+(ntyp-1)*10+0.1*k+0.01*j);
410 catch (MEDMEM::MEDEXCEPTION &m) {
411 CPPUNIT_FAIL(m.what());
415 CPPUNIT_FAIL("Unknown exception");
423 myArray4Ptr = myArray4.getPtr();
424 for (int i =0; i < myArray4.getArraySize(); i++) {
425 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4Ptr[i], array4Ref[i], EPS );
428 //test MEDMEM_Array(const MEDMEM_Array & array, bool shallowCopy=false)
429 MEDMEM_Array<double,NoInterlaceGaussPolicy> myArray4bis(myArray4, false);
430 myArray4Ptr = myArray4bis.getPtr();
433 for (int j=1; j <= mdim; j++)
434 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
435 for (int k=1; k <= myArray4bis.getNbGauss(i); k++) {
436 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4bis.getIJK(i,j,k), array4Ref[elemno], EPS );
437 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4Ptr[elemno], array4Ref[elemno], EPS );
441 //test MEDMEM_Array()
442 MEDMEM_Array<double,NoInterlaceGaussPolicy> myArray4ter;
443 //test operator=(const MEDMEM_Array & array)
444 myArray4ter = myArray4;
445 myArray4Ptr = myArray4ter.getPtr();
448 for (int j=1; j <= mdim; j++)
449 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
450 for (int k=1; k <= myArray4ter.getNbGauss(i); k++) {
451 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4ter.getIJK(i,j,k), array4Ref[elemno], EPS );
452 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4Ptr[elemno], array4Ref[elemno], EPS );
457 MEDMEM_Array<double,NoInterlaceGaussPolicy> myArray4qua (mdim,nbelem2,nbtypegeo,nbelgeoc,nbgaussgeo);
458 myArray4Ptr = myArray4qua.getPtr();
460 for (int j = 1; j <= mdim; j++) {
461 int k = (myArray4qua.getArraySize() / mdim) * (j - 1);
462 CPPUNIT_ASSERT_NO_THROW(myArray4qua.setColumn(j, &array4Ref[k]));
465 for (int i =0; i < myArray4qua.getArraySize(); i++)
466 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4Ptr[i], array4Ref[i], EPS );
470 MEDMEM_Array<double,FullInterlaceGaussPolicy> * myArray4cin = ArrayConvert(myArray4);
471 myArray4Ptr = myArray4cin->getPtr();
473 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
474 for (int k=1; k <= myArray4cin->getNbGauss(i); k++)
475 for (int j=1; j <= mdim; j++) {
476 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4cin->getIJK(i,j,k), array3Ref[elemno], EPS );
477 CPPUNIT_ASSERT( myArray4cin->getIJK(i,j,k) == myArray3.getIJK(i,j,k) );
478 CPPUNIT_ASSERT_DOUBLES_EQUAL( myArray4Ptr[elemno], array3Ref[elemno], EPS );
484 CPPUNIT_ASSERT(myArray4bis.getInterlacingType() != MED_UNDEFINED_INTERLACE);
486 CPPUNIT_ASSERT_THROW(myArray4.getIJ(0,2), MEDEXCEPTION);
489 //test operator<<(ostream & os, const MEDMEM_Array & array)
491 CPPUNIT_ASSERT(os.str() != "");
493 const int * myArray5Ptr = 0;
494 //test MEDMEM_Array(ElementType * values, int dim, int nbelem, int nbtypegeo,
495 // const int * const nbelgeoc, const int * const nbgaussgeo,
496 // bool shallowCopy=false, bool ownershipOfValues=false)
497 MEDMEM_Array<int, NoInterlaceGaussPolicy> myArray5 ((int*)array5Ref, mdim, nbelem2,
498 nbtypegeo, nbelgeoc, nbgaussgeo);
499 //test getGaussPresence
500 CPPUNIT_ASSERT( myArray5.getGaussPresence());
502 myArray5Ptr = myArray5.getPtr();
503 for (int i =0; i < myArray5.getArraySize(); i++) {
504 CPPUNIT_ASSERT_EQUAL( myArray5Ptr[i], array5Ref[i]);
507 //test MEDMEM_Array(const MEDMEM_Array & array, bool shallowCopy=false)
508 MEDMEM_Array<int,NoInterlaceGaussPolicy> myArray5bis(myArray5, false);
509 myArray5Ptr = myArray5bis.getPtr();
512 for (int j=1; j <= mdim; j++)
513 for (int i=1; i < nbelgeoc[nbtypegeo] ; i++ )
514 for (int k=1; k <= myArray5bis.getNbGauss(i); k++) {
515 CPPUNIT_ASSERT_EQUAL( myArray5bis.getIJK(i,j,k), array5Ref[elemno] );
516 CPPUNIT_ASSERT_EQUAL( myArray5Ptr[elemno], array5Ref[elemno] );
521 MEDMEM_Array<int,NoInterlaceGaussPolicy> myArray5ter;
522 //test setPtr(ElementType * values, bool shallowCopy=false, bool ownershipOfValues=false)
523 CPPUNIT_ASSERT_NO_THROW(myArray5.setPtr((int*)array5Ref));
526 myArray5Ptr = myArray5ter.getPtr();
527 for (int i =0; i < myArray5ter.getArraySize(); i++) {
528 CPPUNIT_ASSERT_EQUAL( myArray5Ptr[i], array5Ref[i]);