/[escript]/trunk/escript/test/DataTestCase.cpp
ViewVC logotype

Contents of /trunk/escript/test/DataTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (show annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 4 months ago) by jfenwick
File size: 35317 byte(s)
Updating copyright notices
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #include <iostream>
16 #if defined (_WIN32) && defined (__INTEL_COMPILER)
17 #include <mathimf.h>
18 #else
19 #include <math.h>
20 #endif
21
22 #include "DataTestCase.h"
23
24 #include "escript/FunctionSpace.h"
25 #include "esysUtils/EsysException.h"
26
27 #include "escript/Data.h"
28 #include "escript/DataLazy.h"
29 #include "escript/EscriptParams.h"
30
31 #define AUTOLAZYON setEscriptParamInt("AUTOLAZY",1);
32 #define AUTOLAZYOFF setEscriptParamInt("AUTOLAZY",0);
33 #define CHECKAUTOLAZY (getEscriptParamInt("AUTOLAZY")==1)
34 #define SAVELAZYSTATE int LAZYSTATE=getEscriptParamInt("AUTOLAZY");
35 #define RESTORELAZYSTATE setEscriptParamInt("AUTOLAZY",LAZYSTATE);
36
37
38
39 using namespace std;
40 using namespace CppUnitTest;
41 using namespace escript;
42 using namespace esysUtils;
43 using namespace escript::DataTypes;
44
45 void DataTestCase::setUp() {
46 //
47 // This is called before each test is run
48 }
49
50 void DataTestCase::tearDown() {
51 //
52 // This is called after each test has been run
53 }
54
55
56
57 namespace
58 {
59
60 inline
61 DataTypes::ValueType::const_reference
62 getRef(Data& d,int s1, int p1, int x, int y)
63 {
64 return d.getDataAtOffsetRO(d.getDataOffset(s1,p1)+getRelIndex(d.getDataPointShape(),x,y));
65 }
66
67 inline
68 DataTypes::ValueType::const_reference
69 getRef(Data& d, int x, int y)
70 {
71 return d.getDataAtOffsetRO(getRelIndex(d.getDataPointShape(),x,y));
72 }
73
74 }
75
76
77 void DataTestCase::testCopyingWorker(bool delayed)
78 {
79
80 using namespace escript::DataTypes;
81 cout << endl;
82
83 DataTypes::ShapeType shape;
84 shape.push_back(2);
85 shape.push_back(3);
86 DataTypes::ValueType data(DataTypes::noValues(shape),1);
87 const int NUMDATS=3;
88 Data* dats[NUMDATS];
89 const char* strs[]={"DataConstant", "DataTagged", "DataExpanded"};
90 dats[0]=new Data(new DataConstant(FunctionSpace(),shape,data));
91 dats[1]=new Data(new DataTagged(FunctionSpace(),shape,data));
92 dats[2]=new Data(new DataExpanded(FunctionSpace(),shape,data));
93 if (delayed)
94 {
95 dats[0]->delaySelf();
96 dats[1]->delaySelf();
97 dats[2]->delaySelf();
98 }
99
100 for (int k=0;k<NUMDATS;++k)
101 {
102 cout << "\tTest deep copy " << strs[k] << endl;
103 Data* d=dats[k];
104 Data deep=d->copySelf(); // test self copy
105 if (delayed)
106 {
107 assert(deep.isLazy());
108 }
109 for (int i=0;i<DataTypes::noValues(shape);++i)
110 {
111 if (d->getDataAtOffsetRO(i)!=deep.getDataAtOffsetRO(i))
112 assert(false);
113 }
114 if (delayed)
115 {
116 d->delaySelf();
117 }
118 d->setToZero();
119 if (delayed)
120 {
121 assert(d->isLazy());
122 }
123 for (int i=0;i<DataTypes::noValues(shape);++i)
124 {
125 if (d->getDataAtOffsetRO(i)==deep.getDataAtOffsetRO(i))
126 assert(false);
127 }
128 if (delayed)
129 {
130 d->delaySelf();
131 deep.delaySelf();
132 }
133 d->copy(deep); // test copy from object
134 if (delayed)
135 {
136 assert(d->isLazy());
137 }
138 for (int i=0;i<DataTypes::noValues(shape);++i)
139 {
140 if (d->getDataAtOffsetRO(i)!=deep.getDataAtOffsetRO(i))
141 assert(false);
142 }
143 d->setToZero();
144 for (int i=0;i<DataTypes::noValues(shape);++i)
145 {
146 if (d->getDataAtOffsetRO(i)==deep.getDataAtOffsetRO(i))
147 assert(false);
148 }
149 delete dats[k];
150 }
151
152
153
154
155
156
157 }
158
159
160 void DataTestCase::testSlicingWorker(bool delayed)
161 {
162
163 using namespace escript::DataTypes;
164 cout << endl;
165 {
166 DataTypes::ShapeType viewShape;
167 viewShape.push_back(2);
168 viewShape.push_back(3);
169
170 const int NUMDATS=3;
171 const char* strs[]={"DataConstant", "DataTagged","DataExpanded"};
172 bool tags[]={false,true,false}; // is the slice of this data supposed to be tagged
173 Data* dats[NUMDATS];
174 for (int k=0;k<NUMDATS;++k)
175 {
176 dats[k]=new Data(1.3, viewShape);
177 }
178 dats[1]->tag();
179 dats[2]->expand();
180 for (int k=0;k<NUMDATS;++k)
181 {
182 Data* temp=dats[k];
183 dats[k]=new Data(dats[k]->delay());
184 delete temp;
185 }
186 for (int k=0;k<NUMDATS;++k)
187 {
188 cout << "\t\tTest get-slicing " << strs[k] << endl;
189 dats[k]->requireWrite();
190 dats[k]->getDataAtOffsetRW(dats[k]->getDataOffset(0,0)+getRelIndex(viewShape,0,0))=1.0;
191 dats[k]->getDataAtOffsetRW(dats[k]->getDataOffset(0,0)+getRelIndex(viewShape,1,1))=2.0;
192
193 DataTypes::RegionType region;
194 region.push_back(DataTypes::RegionType::value_type(0,0));
195 region.push_back(DataTypes::RegionType::value_type(0,0));
196
197 Data slice1(dats[k]->getSlice(region));
198
199 if (tags[k]) {assert(slice1.isTagged());}
200 assert(slice1.getDataPointRank()==0);
201 assert(slice1.getDataPointRO(0,0)==1.0);
202
203 //
204 // create a rank 2 slice with one value
205
206 region.clear();
207 region.push_back(DataTypes::RegionType::value_type(0,1));
208 region.push_back(DataTypes::RegionType::value_type(0,1));
209
210 Data slice2(dats[k]->getSlice(region));
211
212 //cout << slice2.toString() << endl;
213
214 if (tags[k]) {assert(slice2.isTagged());}
215 assert(slice2.getDataPointRank()==2);
216
217 assert(slice2.getDataAtOffsetRO(slice2.getDataOffset(0,0)+getRelIndex(slice2.getDataPointShape(),0,0))==1.0);
218
219 //
220 // create a rank 2 slice with four values
221
222 region.clear();
223 region.push_back(DataTypes::RegionType::value_type(0,2));
224 region.push_back(DataTypes::RegionType::value_type(0,2));
225
226 Data slice3(dats[k]->getSlice(region));
227
228 //cout << slice3.toString() << endl;
229
230 if (tags[k]) {assert(slice3.isTagged());}
231 assert(slice3.getDataPointRank()==2);
232 assert(getRef(slice3,0,0,0,0)==1.0);
233 assert(getRef(slice3,0,0,0,1)==1.3);
234 assert(getRef(slice3,0,0,1,0)==1.3);
235 assert(getRef(slice3,0,0,1,1)==2.0);
236 }
237
238 // now some extra tests for tagged data (dats[1])
239
240 //
241 // add a value for tag "1"
242
243 DataTypes::ValueType viewData(6);
244 for (int i=0;i<viewData.size();i++) {
245 viewData[i]=i;
246 }
247 dats[1]->setTaggedValueFromCPP(1, viewShape, viewData);
248
249 //
250 // create a full slice
251
252 DataTypes::RegionType region;
253 region.push_back(DataTypes::RegionType::value_type(0,2));
254 region.push_back(DataTypes::RegionType::value_type(0,3));
255
256 Data slice4(dats[1]->getSlice(region));
257
258 assert(slice4.isTagged());
259 assert(slice4.getDataPointRank()==2);
260 assert(getRef(slice4,0,0,0,0)==0);
261 assert(getRef(slice4,0,0,0,1)==2);
262 assert(getRef(slice4,0,0,0,2)==4);
263 assert(getRef(slice4,0,0,1,0)==1);
264 assert(getRef(slice4,0,0,1,1)==3);
265 assert(getRef(slice4,0,0,1,2)==5);
266
267 for (int k=0;k<NUMDATS;++k)
268 {
269 delete dats[k];
270 }
271 }
272
273 {
274 DataTypes::ShapeType viewShape;
275 viewShape.push_back(2);
276 viewShape.push_back(3);
277
278 const int NUMDATS=3;
279 const char* strs[]={"DataConstant", "DataTagged","DataExpanded"};
280 Data* dats[NUMDATS];
281 Data* src[NUMDATS];
282 for (int k=0;k<NUMDATS;++k)
283 {
284 dats[k]=new Data(1.3, viewShape);
285 src[k]=new Data(10,DataTypes::scalarShape);
286 }
287 dats[1]->tag();
288 src[1]->tag();
289 dats[2]->expand();
290 src[2]->expand();
291 if (delayed)
292 {
293 for(int k=0;k<NUMDATS;++k)
294 {
295 if (delayed)
296 {
297 Data* temp=dats[k];
298 dats[k]=new Data(dats[k]->delay()); // coz delay returns an object not a pointer
299 delete temp;
300 temp=src[k];
301 src[k]=new Data(src[k]->delay());
302 delete temp;
303 }
304 }
305 }
306 for (int k=0;k<NUMDATS;++k)
307 {
308 cout << "\t\tTest set-slicing " << strs[k] << endl;
309 Data target(1.3,viewShape);
310 if (k==2) {target.expand();}
311 DataTypes::RegionType region;
312 region.push_back(DataTypes::RegionType::value_type(1,1));
313 region.push_back(DataTypes::RegionType::value_type(1,1));
314 target.setSlice(*(src[k]),region);
315 assert(getRef(target,0,0,1,1)==src[k]->getDataPointRO(0,0));
316 }
317
318 // some extra tests on tagged data
319
320 //
321 // add a value for tag "1" to target
322
323 DataTypes::ValueType viewData(6);
324 for (int i=0;i<viewData.size();i++) {
325 viewData[i]=i;
326 }
327
328 Data target(1.3,viewShape,FunctionSpace(),false);
329 target.tag();
330 target.setTaggedValueFromCPP(1, viewShape, viewData);
331
332 //cout << "target:\n" << target.toString() << endl;
333
334 //
335 // set a slice in target from source
336
337 DataTypes::RegionType region;
338 region.push_back(DataTypes::RegionType::value_type(0,0));
339 region.push_back(DataTypes::RegionType::value_type(1,1));
340
341 target.setSlice(*src[1],region);
342
343 assert(target.isTagged());
344 assert(target.getDataPointRank()==2);
345 assert(getRef(target,0,0,0,0)==0);
346 assert(getRef(target,0,0,0,1)==src[1]->getDataPointRO(0,0));
347 assert(getRef(target,0,0,0,2)==4);
348 assert(getRef(target,0,0,1,0)==1);
349 assert(getRef(target,0,0,1,1)==3);
350 assert(getRef(target,0,0,1,2)==5);
351
352 //
353 // add a value for tag "2" to source
354
355 DataTypes::ShapeType viewShape2;
356 DataTypes::ValueType viewData2(1);
357 viewData2[0]=6;
358 src[1]->setTaggedValueFromCPP(2, viewShape2, viewData2);
359
360 region.clear();
361 region.push_back(DataTypes::RegionType::value_type(0,0));
362 region.push_back(DataTypes::RegionType::value_type(1,1));
363
364 target.setSlice(*src[1],region);
365
366 assert(target.isTagged());
367 assert(target.getDataPointRank()==2);
368
369 // use a non-existant tag so we get a pointer to the default value
370 // ie: the first element in the data array
371 DataAbstract::ValueType::value_type* targetData=target.getSampleDataByTag(9);
372 for (int i=0; i<target.getLength(); i++) {
373 assert(targetData[i]>=0);
374 }
375 assert(targetData[0]==1.3);
376 assert(targetData[1]==1.3);
377 assert(targetData[2]==10);
378 assert(targetData[3]==1.3);
379 assert(targetData[4]==1.3);
380 assert(targetData[5]==1.3);
381 assert(targetData[6]==0);
382 assert(targetData[7]==1);
383 assert(targetData[8]==10);
384 assert(targetData[9]==3);
385 assert(targetData[10]==4);
386 assert(targetData[11]==5);
387 assert(targetData[12]==1.3);
388 assert(targetData[13]==1.3);
389 assert(targetData[14]==6);
390 assert(targetData[15]==1.3);
391 assert(targetData[16]==1.3);
392 assert(targetData[17]==1.3);
393
394
395 for (int k=0;k<NUMDATS;++k)
396 {
397 delete dats[k];
398 delete src[k];
399 }
400
401 }
402
403 }
404
405 // This is to test new copy routines, existing tests should remain where they are
406 void DataTestCase::testCopying()
407 {
408 cout << "\n\tReadyData." << endl;
409 testCopyingWorker(false);
410 cout << "\n\tLazyData." << endl;
411 testCopyingWorker(true);
412 }
413
414 void DataTestCase::testSlicing() {
415 cout << "\n\tReadyData." << endl;
416 testSlicingWorker(false);
417 cout << "\n\tLazyData." << endl;
418 testSlicingWorker(true);
419 }
420
421
422 void DataTestCase::testSomeDriver(bool autolazy)
423 {
424 cout << endl;
425 SAVELAZYSTATE
426 if (autolazy)
427 {
428 AUTOLAZYON
429 cout << "\tNow testing using autolazy." << endl;
430 }
431 cout << "\tCreate a Data object." << endl;
432
433 DataTypes::ShapeType viewShape;
434 viewShape.push_back(3);
435 DataTypes::ValueType viewData(3);
436 for (int i=0;i<viewShape[0];++i) {
437 viewData[i]=i;
438 }
439
440 bool expanded=true;
441 Data exData(viewData,viewShape,FunctionSpace(),expanded);
442 Data cData(viewData,viewShape);
443 Data result;
444
445 assert(exData.isExpanded());
446 assert(cData.isConstant());
447 assert(result.isEmpty());
448
449 cout << "\tTest some basic operations" << endl;
450 result=exData*cData;
451 cout << CHECKAUTOLAZY << " " << result.isLazy() << " " << result.isExpanded()<< endl;
452 assert(CHECKAUTOLAZY?result.isLazy():result.isExpanded());
453
454 assert(result.Lsup()==4);
455 assert(result.sup()==4);
456 assert(result.inf()==0);
457
458 result=exData+cData;
459 result=exData-cData;
460 result=exData/cData;
461
462 cout << "\tExercise wherePositive method" << endl;
463 assert(!exData.wherePositive().isEmpty());
464
465 cout << "\tExercise copyWithMask method" << endl;
466 exData.copyWithMask(result, exData.wherePositive());
467 assert(!exData.wherePositive().isEmpty());
468 RESTORELAZYSTATE
469
470 }
471
472 void DataTestCase::testSome() {
473 testSomeDriver(false);
474 testSomeDriver(true);
475 }
476
477
478
479 // This method tests to see if resolve() produces results of the correct type
480 void DataTestCase::testResolveType()
481 {
482 cout << endl;
483 cout << "\tTesting resolve()\n";
484 DataTypes::ShapeType viewShape;
485 viewShape.push_back(2);
486 viewShape.push_back(3);
487 viewShape.push_back(4);
488 DataTypes::ValueType viewData(2*3*4);
489 for (int i=0;i<DataTypes::noValues(viewShape);++i) {
490 viewData[i]=i;
491 }
492 Data c1(viewData,viewShape);
493 Data t1(viewData,viewShape);
494 Data e1(viewData,viewShape);
495 t1.tag();
496 e1.expand();
497 c1.delaySelf();
498 t1.delaySelf();
499 e1.delaySelf();
500 Data d1=c1+c1;
501 assert(d1.isLazy());
502 assert((d1.resolve(),d1.isConstant()));
503 d1=c1+t1;
504 assert(d1.isLazy());
505 assert((d1.resolve(),d1.isTagged()));
506 d1=t1+c1;
507 assert(d1.isLazy());
508 assert((d1.resolve(),d1.isTagged()));
509 d1=t1+t1;
510 assert(d1.isLazy());
511 assert((d1.resolve(),d1.isTagged()));
512 d1=c1+e1;
513 assert(d1.isLazy());
514 assert((d1.resolve(),d1.isExpanded()));
515 d1=e1+c1;
516 assert(d1.isLazy());
517 assert((d1.resolve(),d1.isExpanded()));
518 d1=e1+t1;
519 assert(d1.isLazy());
520 assert((d1.resolve(),d1.isExpanded()));
521 d1=t1+e1;
522 assert(d1.isLazy());
523 assert((d1.resolve(),d1.isExpanded()));
524 d1=e1+e1;
525 assert(d1.isLazy());
526 assert((d1.resolve(),d1.isExpanded()));
527 cout << "\tTesting tag()\n";
528 c1.tag();
529 assert(c1.isTagged());
530 t1.tag();
531 assert(t1.isTagged());
532 try
533 {
534 e1.tag();
535 assert(false); // this should have thrown
536 } catch(...) {}
537 cout << "\tTesting expand()\n";
538 Data c2(viewData,viewShape);
539 Data t2(viewData,viewShape);
540 Data e2(viewData,viewShape);
541 t2.tag();
542 e2.expand();
543 c2.delaySelf();
544 t2.delaySelf();
545 e2.delaySelf();
546 c2.expand();
547 assert(c2.isExpanded());
548 t2.expand();
549 assert(t2.isExpanded());
550 e2.expand();
551 assert(e2.isExpanded());
552 }
553
554 void DataTestCase::testDataConstant() {
555
556 cout << endl;
557
558 cout << "\tCreate a DataConstant object." << endl;
559
560 DataTypes::ShapeType viewShape;
561 viewShape.push_back(2);
562 viewShape.push_back(3);
563 viewShape.push_back(4);
564 DataTypes::ValueType viewData(2*3*4);
565 for (int i=0;i<DataTypes::noValues(viewShape);++i) {
566 viewData[i]=i;
567 }
568
569 Data left(viewData,viewShape);
570 Data right(viewData,viewShape);
571 Data result;
572
573 cout << "\tTest some basic operations" << endl;
574
575 result=left-right;
576
577 assert(left.isConstant());
578 assert(right.isConstant());
579 assert(result.isConstant());
580
581 result=left+right;
582
583 assert(left.isConstant());
584 assert(right.isConstant());
585 assert(result.isConstant());
586
587 assert(!result.isExpanded());
588 assert(!result.isTagged());
589
590 }
591
592 void DataTestCase::testDataTagged() {
593
594 cout << endl;
595
596 {
597
598 cout << "\tCreate a DataTagged object with a default value only." << endl;
599
600 DataTypes::ShapeType viewShape;
601 viewShape.push_back(3);
602
603 DataTypes::ValueType viewData(3);
604 for (int i=0;i<viewShape[0];i++) {
605 viewData[i]=i;
606 }
607 int arr[1]={1}; // iso c++ does not like empty arrays
608 DataTagged* dt=new DataTagged(FunctionSpace(),viewShape,arr,viewData);
609 Data myData(dt);
610
611 assert(!myData.isEmpty());
612 assert(myData.isTagged());
613 assert(myData.getTagNumber(0)==1);
614 assert(myData.getDataPointRank()==1);
615 assert(myData.getLength()==3);
616
617 assert(myData.getNoValues()==3);
618 assert(myData.getDataAtOffsetRO(0)==0.0);
619 assert(myData.getDataAtOffsetRO(1)==1.0);
620 assert(myData.getDataAtOffsetRO(2)==2.0);
621
622 double* sampleData=myData.getSampleDataRW(0);
623 for (int i=0; i<myData.getNoValues(); i++) {
624 assert(sampleData[i]==i);
625 }
626 // use a non-existent tag so we get a pointer to
627 // the first element of the data array
628 sampleData=myData.getSampleDataByTag(9);
629 for (int i=0; i<myData.getLength(); i++) {
630 assert(sampleData[i]==i);
631 }
632
633 cout << "\tTest setting of a tag and associated value." << endl;
634
635 // value for tag "1"
636 DataTypes::ValueType eTwoData(viewData);
637 // DataArrayView eTwoView(eTwoData, viewShape);
638 for (int i=0;i<viewShape[0];i++) {
639 eTwoData[i]=i+2.0;
640 }
641
642 myData.setTaggedValueFromCPP(1,viewShape, eTwoData);
643
644 assert(myData.getLength()==6);
645
646 int offset=myData.getDataOffset(0,0);
647 assert(offset==3);
648 assert(myData.getDataPointRank()==1);
649 assert(myData.getNoValues()==3);
650
651 assert(myData.getDataAtOffsetRO(offset+0)==2);
652 assert(myData.getDataAtOffsetRO(offset+1)==3);
653 assert(myData.getDataAtOffsetRO(offset+2)==4);
654
655 sampleData=myData.getSampleDataByTag(1);
656 for (int i=0; i<myData.getNoValues(); i++) {
657 assert(sampleData[i]==i+2);
658 }
659
660 }
661
662 {
663
664 cout << "\tCreate a DataTagged object via tag() method." << endl;
665
666 DataTypes::ShapeType viewShape;
667 viewShape.push_back(2);
668 viewShape.push_back(3);
669 Data myData(1.3,viewShape,FunctionSpace(),false);
670 myData.tag();
671
672 assert(!myData.isEmpty());
673 assert(myData.isTagged());
674 assert(myData.getTagNumber(0)==1);
675 assert(myData.getDataPointRank()==2);
676 assert(myData.getLength()==6);
677
678 // check default value
679 assert(!myData.isEmpty());
680 assert(myData.getDataPointRank()==2);
681 assert(myData.getNoValues()==6);
682 assert(myData.getDataPointShape().size()==2);
683 assert(getRef(myData,0,0)==1.3);
684 assert(getRef(myData,0,1)==1.3);
685 assert(getRef(myData,0,2)==1.3);
686 assert(getRef(myData,1,0)==1.3);
687 assert(getRef(myData,1,1)==1.3);
688 assert(getRef(myData,1,2)==1.3);
689
690 // check value for data-point (0,0).
691 // myDataView = myData.getDataPoint(0,0);
692 assert(!myData.isEmpty());
693 // assert(myDataView.getOffset()==0);
694 assert(myData.getDataPointRank()==2);
695 assert(myData.getNoValues()==6);
696 assert(myData.getDataPointShape().size()==2);
697 assert(getRef(myData,0,0)==1.3);
698 assert(getRef(myData,0,1)==1.3);
699 assert(getRef(myData,0,2)==1.3);
700 assert(getRef(myData,1,0)==1.3);
701 assert(getRef(myData,1,1)==1.3);
702 assert(getRef(myData,1,2)==1.3);
703
704 }
705
706 }
707
708 void DataTestCase::testDataTaggedExceptions() {
709
710 cout << endl;
711
712 cout << "\tTest DataTagged exceptions." << endl;
713
714 Data myData;
715
716 try {
717 myData.getSampleDataByTag(0);;
718 assert(false);
719 }
720 catch (EsysException&) {
721 //cout << e.what() << endl;
722 assert(true);
723 }
724
725 try {
726 myData.setTaggedValueFromCPP(0,DataTypes::ShapeType(), DataTypes::ValueType());;
727 assert(false);
728 }
729 catch (EsysException&) {
730 //cout << e.what() << endl;
731 assert(true);
732 }
733
734 }
735
736 void DataTestCase::testConstructors() {
737
738 cout << endl;
739
740 DataTypes::ShapeType viewShape;
741 {
742 cout << "\tCreate an Empty Data object" << endl;
743 Data temp(1.3,viewShape,FunctionSpace(),false);
744 }
745 {
746 cout << "\tCreate a rank 2 Data object" << endl;
747 viewShape.push_back(2);
748 viewShape.push_back(3);
749 Data temp(1.3,viewShape,FunctionSpace(),false);
750 }
751 }
752
753
754 void DataTestCase::testOperations()
755 {
756
757 cout << endl;
758
759 // define the shape for the test data
760 DataTypes::ShapeType shape;
761 shape.push_back(2);
762 shape.push_back(3);
763
764 // allocate the data
765 DataTypes::ValueType data(DataTypes::noValues(shape),0);
766
767 // assign values to the data
768 for (int i=0;i<shape[0];i++) {
769 for (int j=0;j<shape[1];j++) {
770 data[getRelIndex(shape,i,j)]=getRelIndex(shape,i,j);
771 }
772 }
773
774
775
776 Data dats[]={Data(data,shape,FunctionSpace(),false),
777 Data(data,shape,FunctionSpace(),false),
778 Data(data,shape,FunctionSpace(),true),
779 Data(data,shape,FunctionSpace(),false),
780 Data(data,shape,FunctionSpace(),false),
781 Data(data,shape,FunctionSpace(),true)};
782 const int NUMDATS=6;
783 const int LAZY=3; // where do the lazy objects start?
784
785 // Data baseEx(data,shape,FunctionSpace(),true);
786 // Data baseCon(data,shape,FunctionSpace(),false);
787 // Data baseTag(data,shape,FunctionSpace(),false);
788 Data& baseCon=dats[0];
789 Data& baseTag=dats[1];
790 Data& baseEx=dats[2];
791 baseTag.tag();
792 dats[4].tag();
793 dats[3].delaySelf();
794 dats[4].delaySelf();
795 dats[5].delaySelf();
796
797 assert(baseEx.isExpanded());
798 assert(baseCon.isConstant());
799 assert(baseTag.isTagged());
800
801 Data results[NUMDATS];
802 // Data& resultEx=results[0];
803 // Data& resultCon=results[1];
804 // Data& resultTag=results[2];
805
806 // create 0 <= smalldata <= 1 for testing trig functions
807
808 DataTypes::ValueType smalldata(DataTypes::noValues(shape),0);
809
810 // assign values to the data
811 for (int i=0;i<shape[0];i++) {
812 for (int j=0;j<shape[1];j++) {
813 smalldata[getRelIndex(shape,i,j)]=(i==0 && j==0)?0:1.0/(getRelIndex(shape,i,j)+1);
814 }
815 }
816 Data sdats[]={Data(smalldata,shape,FunctionSpace(),false),
817 Data(smalldata,shape,FunctionSpace(),false),
818 Data(smalldata,shape,FunctionSpace(),true),
819 Data(smalldata,shape,FunctionSpace(),false),
820 Data(smalldata,shape,FunctionSpace(),false),
821 Data(smalldata,shape,FunctionSpace(),true)};
822 sdats[1].tag();
823 sdats[4].tag();
824 sdats[3].delaySelf(); // 3 is a lazy constant
825 sdats[4].delaySelf(); // 4 is a lazy tagged
826 sdats[5].delaySelf(); // 5 is a lazy expanded
827
828
829
830 // test unary operations
831
832 double tmp;
833 cout << "\tTest Data::pow." << endl;
834 Data power(3.0,shape,FunctionSpace(),true);
835 for (int z=0;z<NUMDATS;++z)
836 {
837 results[z].copy(dats[z].powD(power));
838 if (z>=LAZY)
839 {
840 assert(results[z].isLazy());
841 }
842 }
843 for (int i=0;i<shape[0];i++) {
844 for (int j=0;j<shape[1];j++) {
845 tmp=pow((double)data[getRelIndex(shape,i,j)],(double)3.0);
846 for (int z=0;z<NUMDATS;++z)
847 {
848 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
849 }
850 }
851 }
852
853 cout << "\tTest Data::sin." << endl;
854 for (int z=0;z<NUMDATS;++z)
855 {
856 results[z].copy(dats[z].sin());
857 if (z>=LAZY)
858 {
859 assert(results[z].isLazy());
860 }
861 }
862 for (int i=0;i<shape[0];i++) {
863 for (int j=0;j<shape[1];j++) {
864 tmp=sin((double)data[getRelIndex(shape,i,j)]);
865 for (int z=0;z<NUMDATS;++z)
866 {
867 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
868 }
869 }
870 }
871
872 cout << "\tTest Data::cos." << endl;
873 for (int z=0;z<NUMDATS;++z)
874 {
875 results[z].copy(dats[z].cos());
876 if (z>=LAZY)
877 {
878 assert(results[z].isLazy());
879 }
880 }
881 for (int i=0;i<shape[0];i++) {
882 for (int j=0;j<shape[1];j++) {
883 tmp=cos((double)data[getRelIndex(shape,i,j)]);
884 for (int z=0;z<NUMDATS;++z)
885 {
886 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
887 }
888 }
889 }
890
891 cout << "\tTest Data::tan." << endl;
892 for (int z=0;z<NUMDATS;++z)
893 {
894 results[z].copy(dats[z].tan());
895 if (z>=LAZY)
896 {
897 assert(results[z].isLazy());
898 }
899 }
900 for (int i=0;i<shape[0];i++) {
901 for (int j=0;j<shape[1];j++) {
902 tmp=tan((double)data[getRelIndex(shape,i,j)]);
903 for (int z=0;z<NUMDATS;++z)
904 {
905 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
906 }
907 }
908 }
909
910 cout << "\tTest Data::asin." << endl;
911 for (int z=0;z<NUMDATS;++z)
912 {
913 results[z].copy(sdats[z].asin());
914 if (z>=LAZY)
915 {
916 assert(results[z].isLazy());
917 }
918 }
919 for (int i=0;i<shape[0];i++) {
920 for (int j=0;j<shape[1];j++) {
921 tmp=asin((double)smalldata[getRelIndex(shape,i,j)]);
922 for (int z=0;z<NUMDATS;++z)
923 {
924 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
925 }
926 }
927 }
928
929 cout << "\tTest Data::acos." << endl;
930 for (int z=0;z<NUMDATS;++z)
931 {
932 results[z].copy(sdats[z].acos());
933 if (z>=LAZY)
934 {
935 assert(results[z].isLazy());
936 }
937 }
938 for (int i=0;i<shape[0];i++) {
939 for (int j=0;j<shape[1];j++) {
940 tmp=acos((double)smalldata[getRelIndex(shape,i,j)]);
941 for (int z=0;z<NUMDATS;++z)
942 {
943 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
944 }
945 }
946 }
947
948 cout << "\tTest Data::atan." << endl;
949 for (int z=0;z<NUMDATS;++z)
950 {
951 results[z].copy(sdats[z].atan());
952 if (z>=LAZY)
953 {
954 assert(results[z].isLazy());
955 }
956 }
957 for (int i=0;i<shape[0];i++) {
958 for (int j=0;j<shape[1];j++) {
959 tmp=atan((double)smalldata[getRelIndex(shape,i,j)]);
960 for (int z=0;z<NUMDATS;++z)
961 {
962 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
963 }
964 }
965 }
966
967 cout << "\tTest Data::sinh." << endl;
968 for (int z=0;z<NUMDATS;++z)
969 {
970 results[z].copy(dats[z].sinh());
971 if (z>=LAZY)
972 {
973 assert(results[z].isLazy());
974 }
975 }
976 for (int i=0;i<shape[0];i++) {
977 for (int j=0;j<shape[1];j++) {
978 tmp=sinh((double)data[getRelIndex(shape,i,j)]);
979 for (int z=0;z<NUMDATS;++z)
980 {
981 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
982 }
983 }
984 }
985
986 cout << "\tTest Data::cosh." << endl;
987 for (int z=0;z<NUMDATS;++z)
988 {
989 results[z].copy(dats[z].cosh());
990 if (z>=LAZY)
991 {
992 assert(results[z].isLazy());
993 }
994 }
995 for (int i=0;i<shape[0];i++) {
996 for (int j=0;j<shape[1];j++) {
997 tmp=cosh((double)data[getRelIndex(shape,i,j)]);
998 for (int z=0;z<NUMDATS;++z)
999 {
1000 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1001 }
1002 }
1003 }
1004
1005 cout << "\tTest Data::tanh." << endl;
1006 for (int z=0;z<NUMDATS;++z)
1007 {
1008 results[z].copy(dats[z].tanh());
1009 if (z>=LAZY)
1010 {
1011 assert(results[z].isLazy());
1012 }
1013 }
1014 for (int i=0;i<shape[0];i++) {
1015 for (int j=0;j<shape[1];j++) {
1016 tmp=tanh((double)data[getRelIndex(shape,i,j)]);
1017 for (int z=0;z<NUMDATS;++z)
1018 {
1019 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1020 }
1021 }
1022 }
1023
1024 // rather than accomodate the different windows operations directly I'll just use inverse functions
1025 cout << "\tTest Data::asinh." << endl;
1026 for (int z=0;z<NUMDATS;++z)
1027 {
1028 results[z].copy(dats[z].asinh().sinh());
1029 if (z>=LAZY)
1030 {
1031 assert(results[z].isLazy());
1032 }
1033 }
1034 for (int i=0;i<shape[0];i++) {
1035 for (int j=0;j<shape[1];j++) {
1036 tmp=data[getRelIndex(shape,i,j)];
1037 for (int z=0;z<NUMDATS;++z)
1038 {
1039 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1040 }
1041 }
1042 }
1043
1044 cout << "\tTest Data::acosh." << endl;
1045 for (int z=0;z<NUMDATS;++z)
1046 {
1047 results[z].copy(dats[z].acosh().cosh());
1048 if (z>=LAZY)
1049 {
1050 assert(results[z].isLazy());
1051 }
1052 }
1053 for (int i=0;i<shape[0];i++) {
1054 for (int j=0;j<shape[1];j++) {
1055 if (i==0 && j==0) break;
1056 tmp=data[getRelIndex(shape,i,j)];
1057 for (int z=0;z<NUMDATS;++z)
1058 {
1059 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1060 }
1061 }
1062 }
1063
1064 cout << "\tTest Data::atanh." << endl;
1065 for (int z=0;z<NUMDATS;++z)
1066 {
1067 results[z].copy(dats[z].tanh().atanh()); // if these are the other way around the results are
1068 if (z>=LAZY) // undefined
1069 {
1070 assert(results[z].isLazy());
1071 }
1072 }
1073 for (int i=0;i<shape[0];i++) {
1074 for (int j=0;j<shape[1];j++) {
1075 tmp=data[getRelIndex(shape,i,j)];
1076 for (int z=0;z<NUMDATS;++z)
1077 {
1078 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1079 }
1080 }
1081 }
1082
1083 cout << "\tTest Data::log." << endl;
1084 for (int z=0;z<NUMDATS;++z)
1085 {
1086 results[z].copy(dats[z].log());
1087 if (z>=LAZY)
1088 {
1089 assert(results[z].isLazy());
1090 }
1091 }
1092 for (int i=0;i<shape[0];i++) {
1093 for (int j=0;j<shape[1];j++) {
1094 if (i==0 && j==0) break;
1095 tmp=log((double)data[getRelIndex(shape,i,j)]);
1096 for (int z=0;z<NUMDATS;++z)
1097 {
1098 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1099 }
1100 }
1101 }
1102
1103 cout << "\tTest Data::log10." << endl;
1104 for (int z=0;z<NUMDATS;++z)
1105 {
1106 results[z].copy(dats[z].log10());
1107 if (z>=LAZY)
1108 {
1109 assert(results[z].isLazy());
1110 }
1111 }
1112 for (int i=0;i<shape[0];i++) {
1113 for (int j=0;j<shape[1];j++) {
1114 if (i==0 && j==0) break;
1115 tmp=log10((double)data[getRelIndex(shape,i,j)]);
1116 for (int z=0;z<NUMDATS;++z)
1117 {
1118 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1119 }
1120 }
1121 }
1122 #if defined (_WIN32) && !defined (__INTEL_COMPILER)
1123 cout << "\tSkip test Data::erf on windows with MSVC compiler." << endl;
1124 #else
1125 cout << "\tTest Data::erf." << endl;
1126 for (int z=0;z<NUMDATS;++z)
1127 {
1128 results[z].copy(dats[z].erf());
1129 if (z>=LAZY)
1130 {
1131 assert(results[z].isLazy());
1132 }
1133 }
1134 for (int i=0;i<shape[0];i++) {
1135 for (int j=0;j<shape[1];j++) {
1136 if (i==0 && j==0) break;
1137 tmp=erf((double)data[getRelIndex(shape,i,j)]);
1138 for (int z=0;z<NUMDATS;++z)
1139 {
1140 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1141 }
1142 }
1143 }
1144 #endif
1145
1146
1147 cout << "\tTest Data::abs." << endl;
1148 for (int z=0;z<NUMDATS;++z)
1149 {
1150 results[z].copy(dats[z].abs());
1151 if (z>=LAZY)
1152 {
1153 assert(results[z].isLazy());
1154 }
1155 }
1156 for (int i=0;i<shape[0];i++) {
1157 for (int j=0;j<shape[1];j++) {
1158 tmp=abs((double)data[getRelIndex(shape,i,j)]);
1159 for (int z=0;z<NUMDATS;++z)
1160 {
1161 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1162 }
1163 }
1164 }
1165
1166 cout << "\tTest Data::sign (positive)." << endl;
1167 for (int z=0;z<NUMDATS;++z)
1168 {
1169 results[z].copy(dats[z].sign());
1170 if (z>=LAZY)
1171 {
1172 assert(results[z].isLazy());
1173 }
1174 }
1175 for (int i=0;i<shape[0];i++) {
1176 for (int j=0;j<shape[1];j++) {
1177 tmp=(i==0 && j==0)?0:1;
1178 for (int z=0;z<NUMDATS;++z)
1179 {
1180 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1181 }
1182 }
1183 }
1184
1185 cout << "\tTest Data::sign (negative)." << endl;
1186 for (int z=0;z<NUMDATS;++z)
1187 {
1188 results[z].copy(dats[z].neg().sign());
1189 if (z>=LAZY)
1190 {
1191 assert(results[z].isLazy());
1192 }
1193 }
1194 for (int i=0;i<shape[0];i++) {
1195 for (int j=0;j<shape[1];j++) {
1196 tmp=(i==0 && j==0)?0:-1;
1197 for (int z=0;z<NUMDATS;++z)
1198 {
1199 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1200 }
1201 }
1202 }
1203
1204
1205 cout << "\tTest Data::exp." << endl;
1206 for (int z=0;z<NUMDATS;++z)
1207 {
1208 results[z].copy(dats[z].exp());
1209 if (z>=LAZY)
1210 {
1211 assert(results[z].isLazy());
1212 }
1213 }
1214 for (int i=0;i<shape[0];i++) {
1215 for (int j=0;j<shape[1];j++) {
1216 tmp=exp((double)data[getRelIndex(shape,i,j)]);
1217 for (int z=0;z<NUMDATS;++z)
1218 {
1219 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1220 }
1221 }
1222 }
1223
1224 cout << "\tTest Data::sqrt." << endl;
1225 for (int z=0;z<NUMDATS;++z)
1226 {
1227 results[z].copy(dats[z].sqrt());
1228 if (z>=LAZY)
1229 {
1230 assert(results[z].isLazy());
1231 }
1232 }
1233 for (int i=0;i<shape[0];i++) {
1234 for (int j=0;j<shape[1];j++) {
1235 tmp=sqrt((double)data[getRelIndex(shape,i,j)]);
1236 for (int z=0;z<NUMDATS;++z)
1237 {
1238 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1239 }
1240 }
1241 }
1242
1243 cout << "\tTest Data::neg." << endl;
1244 for (int z=0;z<NUMDATS;++z)
1245 {
1246 results[z].copy(dats[z].neg());
1247 if (z>=LAZY)
1248 {
1249 assert(results[z].isLazy());
1250 }
1251 }
1252 for (int i=0;i<shape[0];i++) {
1253 for (int j=0;j<shape[1];j++) {
1254 tmp=-data[getRelIndex(shape,i,j)];
1255 for (int z=0;z<NUMDATS;++z)
1256 {
1257 assert(std::abs(getRef(results[z],i,j) - tmp) <= REL_TOL*std::abs(tmp));
1258 }
1259 }
1260 }
1261
1262 cout << "\tTest Data::pos." << endl;
1263 for (int z=0;z<NUMDATS;++z)
1264 {
1265 results[z].copy(dats[z].pos());
1266 if (z>=LAZY)
1267 {
1268 assert(results[z].isLazy());
1269 }
1270 }
1271 for (int i=0;i<shape[0];i++) {
1272 for (int j=0;j<shape[1];j++) {
1273 for (int z=0;z<NUMDATS;++z)
1274 {
1275 assert(std::abs(getRef(results[z],i,j) - getRelIndex(shape,i,j)) <= REL_TOL*std::abs(data[getRelIndex(shape,i,j)]));
1276 }
1277 }
1278 }
1279
1280 // test reduction operations
1281
1282 cout << "\tTest Data::Lsup." << endl;
1283 for (int z=0;z<NUMDATS;++z)
1284 {
1285 assert(std::abs(dats[z].Lsup() - 5) <= REL_TOL*5);
1286 }
1287
1288 cout << "\tTest Data::sup." << endl;
1289 for (int z=0;z<NUMDATS;++z)
1290 {
1291 assert(std::abs(dats[z].sup() - 5) <= REL_TOL*5);
1292 }
1293
1294 cout << "\tTest Data::inf." << endl;
1295 for (int z=0;z<NUMDATS;++z)
1296 {
1297 assert(std::abs(dats[z].inf() - 0) <= REL_TOL*0);
1298 }
1299
1300 // test data-point reduction operations
1301
1302 cout << "\tTest Data::minval." << endl;
1303 for (int z=0;z<NUMDATS;++z)
1304 {
1305 results[z].copy(dats[z].minval());
1306 }
1307 for (int z=0;z<NUMDATS;++z)
1308 {
1309 assert(std::abs(results[z].getDataAtOffsetRO(0) - 0) <= REL_TOL*0);
1310 }
1311
1312
1313 cout << "\tTest Data::maxval." << endl;
1314 for (int z=0;z<NUMDATS;++z)
1315 {
1316 results[z].copy(dats[z].maxval());
1317 }
1318 for (int z=0;z<NUMDATS;++z)
1319 {
1320 assert(std::abs(results[z].getDataAtOffsetRO(0) - 5) <= REL_TOL*5);
1321 }
1322
1323 }
1324
1325
1326 // Here we test the binary operators in complex expressions
1327 void DataTestCase::testBinary()
1328 {
1329
1330 cout << endl;
1331
1332 // define the shape for the test data
1333 DataTypes::ShapeType shape;
1334 shape.push_back(2);
1335 shape.push_back(3);
1336
1337 // allocate the data
1338 DataTypes::ValueType data(DataTypes::noValues(shape),0);
1339
1340 // assign values to the data
1341 for (int i=0;i<shape[0];i++) {
1342 for (int j=0;j<shape[1];j++) {
1343 data[getRelIndex(shape,i,j)]=getRelIndex(shape,i,j)+2; // so we get no zeros
1344 }
1345 }
1346
1347
1348 Data one(1.0,DataTypes::scalarShape,FunctionSpace());
1349 Data two(2.0,DataTypes::scalarShape,FunctionSpace());
1350 Data dats[]={Data(data,shape,FunctionSpace(),false),
1351 Data(data,shape,FunctionSpace(),false),
1352 Data(data,shape,FunctionSpace(),true),
1353 Data(data,shape,FunctionSpace(),false),
1354 Data(data,shape,FunctionSpace(),false),
1355 Data(data,shape,FunctionSpace(),true)};
1356 dats[1].tag();
1357 dats[4].tag();
1358 const int NUMDATS=6;
1359 const int LAZY=3;
1360 dats[3].delaySelf();
1361 dats[4].delaySelf();
1362 dats[5].delaySelf();
1363 for (int z=0;z<NUMDATS;++z)
1364 {
1365 Data& a=dats[z];
1366 Data r1=(((a+a)/two)+a-a)*one; // scalar/*, matrix+-
1367 Data r2=(((a*a)/a+one)-one); // scalar+-, matrix*/
1368 Data r3=(a.powD(two)/a.powD(one)); // scalar power
1369 Data r4=a.powD(a); // matrix power
1370 if (z>LAZY)
1371 {
1372 assert(r1.isLazy() && r2.isLazy() && r3.isLazy() && r4.isLazy());
1373 }
1374 for (int i=0;i<DataTypes::noValues(shape);++i)
1375 {
1376 assert(std::abs(r1.getDataAtOffsetRO(i)-data[i]) <= REL_TOL*data[i]);
1377 assert(std::abs(r2.getDataAtOffsetRO(i)-data[i]) <= REL_TOL*data[i]);
1378 assert(std::abs(r3.getDataAtOffsetRO(i)-data[i]) <= REL_TOL*data[i]);
1379 assert(std::abs(r4.getDataAtOffsetRO(i)-pow(data[i],i)) <=REL_TOL*pow(data[i],i));
1380 }
1381 }
1382 }
1383
1384
1385 void DataTestCase::testMemAlloc() {
1386
1387 //
1388 // Simple little sanity check for the memory allocator
1389
1390 cout << endl;
1391
1392 Data *testData;
1393 for (int i=0; i<1000; i++) {
1394 testData = new Data(0.0, DataTypes::ShapeType(), FunctionSpace(), true);
1395 delete testData;
1396 }
1397
1398 DataTypes::ShapeType viewShape;
1399 viewShape.push_back(10);
1400 viewShape.push_back(10);
1401 viewShape.push_back(10);
1402
1403 Data *testData2;
1404 Data *testData3 = new Data(0.0, viewShape, FunctionSpace(), true);
1405 for (int i=0; i<1000; i++) {
1406 testData2 = new Data(0.0, viewShape, FunctionSpace(), true);
1407 delete testData2;
1408 }
1409 delete testData3;
1410
1411 }
1412
1413 TestSuite* DataTestCase::suite ()
1414 {
1415 //
1416 // create the suite of tests to perform.
1417 TestSuite *testSuite = new TestSuite ("DataTestCase");
1418 testSuite->addTest (new TestCaller< DataTestCase>("testCopying",&DataTestCase::testCopying));
1419 testSuite->addTest (new TestCaller< DataTestCase>("testSome",&DataTestCase::testSome));
1420 testSuite->addTest (new TestCaller< DataTestCase>("testDataConstant",&DataTestCase::testDataConstant));
1421 testSuite->addTest (new TestCaller< DataTestCase>("testDataTagged",&DataTestCase::testDataTagged));
1422 testSuite->addTest (new TestCaller< DataTestCase>("testDataTaggedExceptions",&DataTestCase::testDataTaggedExceptions));
1423 testSuite->addTest (new TestCaller< DataTestCase>("testConstructors",&DataTestCase::testConstructors));
1424 testSuite->addTest (new TestCaller< DataTestCase>("testSlicing",&DataTestCase::testSlicing));
1425 testSuite->addTest (new TestCaller< DataTestCase>("testOperations",&DataTestCase::testOperations));
1426 testSuite->addTest (new TestCaller< DataTestCase>("testMemAlloc",&DataTestCase::testMemAlloc));
1427 testSuite->addTest (new TestCaller< DataTestCase>("Resolving",&DataTestCase::testResolveType));
1428
1429 return testSuite;
1430 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26