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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3597 - (show annotations)
Thu Sep 15 06:03:17 2011 UTC (7 years, 7 months ago) by caltinay
File size: 2117 byte(s)
Switching to external cppunit:
-removed tools/CppUnitTest
-updated scons script and files
-updated tests to changed API
-updated readme

Bumped scons options file version to 201. Additions:
-cppunit*
-boomeramg*
-vsl_random


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 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 "DataCTestCase.h"
16 #include "escript/Data.h"
17 extern "C" {
18 #include "escript/DataC.h"
19 #include "CompareFuncs.h"
20 }
21
22 #include <cppunit/TestCaller.h>
23 #include <iostream>
24
25 using namespace std;
26 using namespace CppUnit;
27 using namespace escript;
28
29 void DataCTestCase::testAll()
30 {
31 cout << endl;
32 cout << "\tTest C interface to escript::Data object." << endl;
33
34 Data myData;
35 escriptDataC myDataC=myData.getDataC();
36 int typeCode=myData.getFunctionSpace().getTypeCode();
37
38 cout << "\tData typeCode: " << typeCode << endl;
39 CPPUNIT_ASSERT(compareTypeCode(&myDataC,typeCode));
40
41 cout << "\tData isEmpty: " << myData.isEmpty() << endl;
42 CPPUNIT_ASSERT(compareIsEmpty(&myDataC,myData.isEmpty()));
43
44 cout << "\tData isExpanded: " << myData.isExpanded() << endl;
45 CPPUNIT_ASSERT(compareIsExpanded(&myDataC,myData.isExpanded()));
46
47 //cout << "Num DataPoints per sample: " << myData.getNumDPPSample() << " num samples: " << myData.getNumSamples() << endl;
48 //CPPUNIT_ASSERT(compareNumSamples(&myDataC,myData.getNumDPPSample(),myData.getNumSamples()));
49
50 //DataArrayView::ShapeType tempShape=myData.getPointDataView().getShape();
51 //cout << "Data rank: " << tempShape.size() << endl;
52 //CPPUNIT_ASSERT(comparePointShape(&myDataC,tempShape.size(),&tempShape[0]));
53
54 //cout << "Data value: " << myData.getSampleData(0)[0] << endl;
55 //cout << "Data value: " << myData.getTaggedSampleData(0)[0] << endl;
56 //CPPUNIT_ASSERT(compareSampleDataWrite(&myDataC,0,myData.getSampleData(0)));
57 }
58
59 TestSuite* DataCTestCase::suite()
60 {
61 TestSuite *testSuite = new TestSuite("DataCTestCase");
62
63 testSuite->addTest(new TestCaller< DataCTestCase>(
64 "testAll",&DataCTestCase::testAll));
65 return testSuite;
66 }
67

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26