/[escript]/branches/windows_from_1456_trunk_1522_merged_in/bruce/test/BruceFactoryTestCase.cpp
ViewVC logotype

Contents of /branches/windows_from_1456_trunk_1522_merged_in/bruce/test/BruceFactoryTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1523 - (show annotations)
Tue Apr 22 06:15:31 2008 UTC (12 years, 10 months ago) by phornby
File size: 2027 byte(s)
Rename to reflect the trunk version merged in.
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