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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 10 months ago) by ksteube
File size: 2027 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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/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