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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 682 - (show annotations)
Mon Mar 27 02:43:09 2006 UTC (13 years, 8 months ago) by robwdcock
File size: 3787 byte(s)
+ NEW BUILD SYSTEM

This commit contains the new build system with cross-platform support.
Most things work are before though you can have more control.

ENVIRONMENT settings have changed:
+ You no longer require LD_LIBRARY_PATH or PYTHONPATH to point to the
esysroot for building and testing performed via scons
+ ACcESS altix users: It is recommended you change your modules to load
the latest intel compiler and other libraries required by boost to match
the setup in svn (you can override). The correct modules are as follows

module load intel_cc.9.0.026
export
MODULEPATH=${MODULEPATH}:/data/raid2/toolspp4/modulefiles/gcc-3.3.6
module load boost/1.33.0/python-2.4.1
module load python/2.4.1
module load numarray/1.3.3


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
15 #include <iostream>
16
17 #include "escript/DataProf.h"
18 #include "esysUtils/EsysException.h"
19
20 #include "DataProfTestCase.h"
21
22 using namespace std;
23 using namespace CppUnitTest;
24 using namespace escript;
25 using namespace esysUtils;
26
27 void DataProfTestCase::setUp() {
28 //
29 // This is called before each test is run
30
31 }
32
33 void DataProfTestCase::tearDown() {
34 //
35 // This is called after each test has been run
36
37 }
38
39 void DataProfTestCase::testAll() {
40 //
41 // The test code may be entered here
42 // There is nothing special about the function name, it may be renamed to
43 // something more suitable.
44 // As many test methods as desired may be added.
45
46 DataProf dataProf;
47
48 profDataEntry* newEntry1 = dataProf.newData();
49 profDataEntry* newEntry2 = dataProf.newData();
50
51 assert(newEntry1->interpolate == 0);
52 assert(newEntry1->grad == 0);
53 assert(newEntry1->integrate == 0);
54 assert(newEntry1->where == 0);
55 assert(newEntry1->unary == 0);
56 assert(newEntry1->binary == 0);
57 assert(newEntry1->reduction1 == 0);
58 assert(newEntry1->reduction2 == 0);
59 assert(newEntry1->slicing == 0);
60
61 assert(newEntry2->interpolate == 0);
62 assert(newEntry2->grad == 0);
63 assert(newEntry2->integrate == 0);
64 assert(newEntry2->where == 0);
65 assert(newEntry2->unary == 0);
66 assert(newEntry2->binary == 0);
67 assert(newEntry2->reduction1 == 0);
68 assert(newEntry2->reduction2 == 0);
69 assert(newEntry2->slicing == 0);
70
71 newEntry1->interpolate = 1;
72 newEntry1->grad = 1;
73 newEntry1->integrate = 1;
74 newEntry1->where = 1;
75 newEntry1->unary = 1;
76 newEntry1->binary = 1;
77 newEntry1->reduction1 = 1;
78 newEntry1->reduction2 = 1;
79 newEntry1->slicing = 1;
80
81 newEntry2->interpolate = 2;
82 newEntry2->grad = 2;
83 newEntry2->integrate = 2;
84 newEntry2->where = 2;
85 newEntry2->unary = 2;
86 newEntry2->binary = 2;
87 newEntry2->reduction1 = 2;
88 newEntry2->reduction2 = 2;
89 newEntry2->slicing = 2;
90
91 assert(newEntry1->interpolate == 1);
92 assert(newEntry1->grad == 1);
93 assert(newEntry1->integrate == 1);
94 assert(newEntry1->where == 1);
95 assert(newEntry1->unary == 1);
96 assert(newEntry1->binary == 1);
97 assert(newEntry1->reduction1 == 1);
98 assert(newEntry1->reduction2 == 1);
99 assert(newEntry1->slicing == 1);
100
101 assert(newEntry2->interpolate == 2);
102 assert(newEntry2->grad == 2);
103 assert(newEntry2->integrate == 2);
104 assert(newEntry2->where == 2);
105 assert(newEntry2->unary == 2);
106 assert(newEntry2->binary == 2);
107 assert(newEntry2->reduction1 == 2);
108 assert(newEntry2->reduction2 == 2);
109 assert(newEntry2->slicing == 2);
110
111 profDataEntry* newEntry3 = dataProf.newData();
112 profDataEntry* newEntry4 = dataProf.newData();
113
114 cout << endl;
115
116 }
117
118 TestSuite* DataProfTestCase::suite ()
119 {
120 //
121 // create the suite of tests to perform.
122 TestSuite *testSuite = new TestSuite ("DataProfTestCase");
123
124 testSuite->addTest (new TestCaller< DataProfTestCase>("testAll",&DataProfTestCase::testAll));
125 return testSuite;
126 }
127

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26