/[escript]/branches/ROBW_XPLATFORM/escript/test/DataCTestCase.cpp
ViewVC logotype

Contents of /branches/ROBW_XPLATFORM/escript/test/DataCTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 636 - (show annotations)
Thu Mar 23 09:46:31 2006 UTC (13 years, 7 months ago) by robwdcock
File size: 2709 byte(s)
Clean up test into single test suite and only one SConscript file so it is easier to maintain.
Note:
+ Use the command line options on tests in order to run only one of them if you need to
+ THIS DOESN'T WORK YET: I've not merged the tests, that will follow shortly
+ I do hope this merges with the changes on the trunk!

1 /*
2 *****************************************************************************
3 * *
4 * COPYRIGHT ACcESS - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 *****************************************************************************
13 */
14 #include "Data.h"
15 extern "C" {
16 #include "DataC.h"
17 #include "CompareFuncs.h"
18 }
19 #include "DataCTestCase.h"
20
21 #include <iostream>
22
23 using namespace std;
24 using namespace CppUnitTest;
25 using namespace escript;
26
27 void DataCTestCase::setUp() {
28 //
29 // This is called before each test is run
30
31 }
32
33 void DataCTestCase::tearDown() {
34 //
35 // This is called after each test has been run
36
37 }
38
39 void DataCTestCase::testAll() {
40
41 cout << endl;
42
43 cout << "\tTest C interface to escript::Data object." << endl;
44
45 Data myData;
46 escriptDataC myDataC=myData.getDataC();
47 int typeCode=myData.getFunctionSpace().getTypeCode();
48
49 cout << "\tData typeCode: " << typeCode << endl;
50 assert(compareTypeCode(&myDataC,typeCode));
51
52 cout << "\tData isEmpty: " << myData.isEmpty() << endl;
53 assert(compareIsEmpty(&myDataC,myData.isEmpty()));
54
55 cout << "\tData isExpanded: " << myData.isExpanded() << endl;
56 assert(compareIsExpanded(&myDataC,myData.isExpanded()));
57
58 //cout << "Num DataPoints per sample: " << myData.getNumDPPSample() << " num samples: " << myData.getNumSamples() << endl;
59 //assert(compareNumSamples(&myDataC,myData.getNumDPPSample(),myData.getNumSamples()));
60
61 //DataArrayView::ShapeType tempShape=myData.getPointDataView().getShape();
62 //cout << "Data rank: " << tempShape.size() << endl;
63 //assert(comparePointShape(&myDataC,tempShape.size(),&tempShape[0]));
64
65 //cout << "Data value: " << myData.getSampleData(0)[0] << endl;
66 //cout << "Data value: " << myData.getTaggedSampleData(0)[0] << endl;
67 //assert(compareSampleDataWrite(&myDataC,0,myData.getSampleData(0)));
68 }
69
70 TestSuite* DataCTestCase::suite ()
71 {
72 //
73 // create the suite of tests to perform.
74 TestSuite *testSuite = new TestSuite ("DataCTestCase");
75
76 testSuite->addTest (new TestCaller< DataCTestCase>("testAll",&DataCTestCase::testAll));
77 return testSuite;
78 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26