/[escript]/trunk/bruce/test/BruceFactoryTestCase.cpp
ViewVC logotype

Contents of /trunk/bruce/test/BruceFactoryTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 700 - (show annotations)
Thu Apr 6 00:13:40 2006 UTC (16 years, 11 months ago) by gross
File size: 2465 byte(s)
A few changes in the build mechanism and the file structure so scons can build release tar files:

  * paso/src/Solver has been moved to paso/src 
  * all test_.py are now run_.py files and are assumed to be passing python tests. they can run by 
    scons py_tests and are part of the release test set
  * escript/py_src/test_ are moved to escript/test/python and are installed in to the build directory 
    (rather then the PYTHONPATH).
  * all py files in test/python which don't start with run_ or test_ are now 'local_py_tests'. they are installed i
    by not run automatically.
  * CppUnitTest is now treated as a escript module (against previous decisions).
  * scons realse builds nor tar/zip files with relvant source code (src and tests in seperate files)

the python tests don't pass yet due to path problems.


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
16 #include "escript/AbstractContinuousDomain.h"
17
18 #include "bruce/BruceFactory.h"
19
20 #include "BruceFactoryTestCase.h"
21
22 #include <iostream>
23
24 using namespace CppUnitTest;
25
26 using namespace escript;
27 using namespace bruce;
28
29 using namespace std;
30
31 void BruceFactoryTestCase::setUp() {
32 //
33 // This is called before each test is run
34
35 }
36
37 void BruceFactoryTestCase::tearDown() {
38 //
39 // This is called after each test has been run
40
41 }
42
43 void BruceFactoryTestCase::testAll() {
44
45 cout << endl;
46
47 cout << "\tTest brick factory." << endl;
48
49 AbstractContinuousDomain* b = brick();
50
51 assert(b->getDim()==3);
52
53 std::pair<int,int> b_shape = b->getDataShape(0);
54
55 assert(b_shape.first==1);
56 assert(b_shape.second==8);
57
58 delete b;
59
60 b = brick(11,11,11,10,10,10);
61
62 assert(b->getDim()==3);
63
64 b_shape = b->getDataShape(0);
65
66 assert(b_shape.first==1);
67 assert(b_shape.second==1331);
68
69 delete b;
70
71
72 cout << "\tTest rectangle factory." << endl;
73
74 AbstractContinuousDomain* r = rectangle();
75
76 assert(r->getDim()==2);
77
78 std::pair<int,int> r_shape = r->getDataShape(0);
79
80 assert(r_shape.first==1);
81 assert(r_shape.second==4);
82
83 delete r;
84
85 r = rectangle(11,11,10,10);
86
87 assert(r->getDim()==2);
88
89 r_shape = r->getDataShape(0);
90
91 assert(r_shape.first==1);
92 assert(r_shape.second==121);
93
94 delete r;
95
96 }
97
98 TestSuite* BruceFactoryTestCase::suite ()
99 {
100 //
101 // create the suite of tests to perform.
102 TestSuite *testSuite = new TestSuite ("BruceFactoryTestCase");
103
104 testSuite->addTest (new TestCaller< BruceFactoryTestCase>("testAll",&BruceFactoryTestCase::testAll));
105 return testSuite;
106 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26