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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (14 years ago) by jgs
Original Path: trunk/escript/test/DataC/DataCTestCase.cpp
File size: 2735 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 jgs 82 /*
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 "escript/Data/Data.h"
15     extern "C" {
16     #include "escript/Data/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