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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 8 months ago) by trankine
File size: 2289 byte(s)
And get the *(&(*&(* name right
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #include "escript/Data.h"
17 extern "C" {
18 #include "escript/DataC.h"
19 #include "CompareFuncs.h"
20 }
21 #include "DataCTestCase.h"
22
23 #include <iostream>
24
25 using namespace std;
26 using namespace CppUnitTest;
27 using namespace escript;
28
29 void DataCTestCase::setUp() {
30 //
31 // This is called before each test is run
32
33 }
34
35 void DataCTestCase::tearDown() {
36 //
37 // This is called after each test has been run
38
39 }
40
41 void DataCTestCase::testAll() {
42
43 cout << endl;
44
45 cout << "\tTest C interface to escript::Data object." << endl;
46
47 Data myData;
48 escriptDataC myDataC=myData.getDataC();
49 int typeCode=myData.getFunctionSpace().getTypeCode();
50
51 cout << "\tData typeCode: " << typeCode << endl;
52 assert(compareTypeCode(&myDataC,typeCode));
53
54 cout << "\tData isEmpty: " << myData.isEmpty() << endl;
55 assert(compareIsEmpty(&myDataC,myData.isEmpty()));
56
57 cout << "\tData isExpanded: " << myData.isExpanded() << endl;
58 assert(compareIsExpanded(&myDataC,myData.isExpanded()));
59
60 //cout << "Num DataPoints per sample: " << myData.getNumDPPSample() << " num samples: " << myData.getNumSamples() << endl;
61 //assert(compareNumSamples(&myDataC,myData.getNumDPPSample(),myData.getNumSamples()));
62
63 //DataArrayView::ShapeType tempShape=myData.getPointDataView().getShape();
64 //cout << "Data rank: " << tempShape.size() << endl;
65 //assert(comparePointShape(&myDataC,tempShape.size(),&tempShape[0]));
66
67 //cout << "Data value: " << myData.getSampleData(0)[0] << endl;
68 //cout << "Data value: " << myData.getTaggedSampleData(0)[0] << endl;
69 //assert(compareSampleDataWrite(&myDataC,0,myData.getSampleData(0)));
70 }
71
72 TestSuite* DataCTestCase::suite ()
73 {
74 //
75 // create the suite of tests to perform.
76 TestSuite *testSuite = new TestSuite ("DataCTestCase");
77
78 testSuite->addTest (new TestCaller< DataCTestCase>("testAll",&DataCTestCase::testAll));
79 return testSuite;
80 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26