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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (hide annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years ago) by ksteube
File size: 2254 byte(s)
Copyright updated in all files

1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4     * Copyright (c) 2003-2008 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 ksteube 1312
14 ksteube 1811
15 robwdcock 670 #include "escript/Data.h"
16 jgs 82 extern "C" {
17 robwdcock 670 #include "escript/DataC.h"
18 jgs 82 #include "CompareFuncs.h"
19     }
20     #include "DataCTestCase.h"
21    
22     #include <iostream>
23    
24     using namespace std;
25     using namespace CppUnitTest;
26     using namespace escript;
27    
28     void DataCTestCase::setUp() {
29     //
30     // This is called before each test is run
31    
32     }
33    
34     void DataCTestCase::tearDown() {
35     //
36     // This is called after each test has been run
37    
38     }
39    
40     void DataCTestCase::testAll() {
41    
42     cout << endl;
43    
44     cout << "\tTest C interface to escript::Data object." << endl;
45    
46     Data myData;
47     escriptDataC myDataC=myData.getDataC();
48     int typeCode=myData.getFunctionSpace().getTypeCode();
49    
50     cout << "\tData typeCode: " << typeCode << endl;
51     assert(compareTypeCode(&myDataC,typeCode));
52    
53     cout << "\tData isEmpty: " << myData.isEmpty() << endl;
54     assert(compareIsEmpty(&myDataC,myData.isEmpty()));
55    
56     cout << "\tData isExpanded: " << myData.isExpanded() << endl;
57     assert(compareIsExpanded(&myDataC,myData.isExpanded()));
58    
59     //cout << "Num DataPoints per sample: " << myData.getNumDPPSample() << " num samples: " << myData.getNumSamples() << endl;
60     //assert(compareNumSamples(&myDataC,myData.getNumDPPSample(),myData.getNumSamples()));
61    
62     //DataArrayView::ShapeType tempShape=myData.getPointDataView().getShape();
63     //cout << "Data rank: " << tempShape.size() << endl;
64     //assert(comparePointShape(&myDataC,tempShape.size(),&tempShape[0]));
65    
66     //cout << "Data value: " << myData.getSampleData(0)[0] << endl;
67     //cout << "Data value: " << myData.getTaggedSampleData(0)[0] << endl;
68     //assert(compareSampleDataWrite(&myDataC,0,myData.getSampleData(0)));
69     }
70    
71     TestSuite* DataCTestCase::suite ()
72     {
73     //
74     // create the suite of tests to perform.
75     TestSuite *testSuite = new TestSuite ("DataCTestCase");
76    
77     testSuite->addTest (new TestCaller< DataCTestCase>("testAll",&DataCTestCase::testAll));
78     return testSuite;
79     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26