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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (hide annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 9 months ago) by jfenwick
File size: 2342 byte(s)
Don't panic.
Updating copyright stamps

1 jgs 117
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
15 robwdcock 670 #include "escript/FunctionSpace.h"
16     #include "escript/NullDomain.h"
17 jgs 82
18     #include "FunctionSpaceTestCase.h"
19    
20     #include <iostream>
21     #include <sstream>
22    
23     using namespace CppUnitTest;
24     using namespace escript;
25     using namespace std;
26    
27     void FunctionSpaceTestCase::setUp() {
28     //
29     // This is called before each test is run
30    
31     }
32    
33     void FunctionSpaceTestCase::tearDown() {
34     //
35     // This is called after each test has been run
36    
37     }
38    
39     void FunctionSpaceTestCase::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     cout << endl;
47    
48 jgs 117 cout << "\tTest default FunctionSpace constructor." << endl;
49    
50 jgs 82 // Test Default constructor
51 jgs 121 FunctionSpace testFunctionSpace0;
52 jgs 82 FunctionSpace testFunctionSpace1;
53    
54 jgs 121 assert(testFunctionSpace0==testFunctionSpace1);
55    
56 jgs 117 cout << "\tTest FunctionSpace constructor." << endl;
57    
58 jgs 82 // Test constructor
59 jfenwick 1872 NullDomain* nullDomain=new NullDomain(); // the shared ptr will deal with it
60     int testfunctionSpaceType = nullDomain->getFunctionCode();
61     Domain_ptr nulldom(nullDomain);
62 jgs 82
63 jfenwick 1872 FunctionSpace testFunctionSpace2(nulldom, testfunctionSpaceType);
64 jgs 82
65 jgs 117 assert(testFunctionSpace1.getTypeCode()==testfunctionSpaceType);
66 jfenwick 1872 assert(*(testFunctionSpace2.getDomain())==*nullDomain);
67 jgs 82 assert(testFunctionSpace1.getDim()==1);
68     assert(testFunctionSpace1==testFunctionSpace1);
69     assert(!(testFunctionSpace1!=testFunctionSpace1));
70    
71 jfenwick 1872 FunctionSpace testFunctionSpace3=testFunctionSpace2; // test copy constructor
72     cout << "Testing equality\n";
73     assert(testFunctionSpace3==testFunctionSpace2);
74 jgs 82
75     }
76    
77     TestSuite* FunctionSpaceTestCase::suite ()
78     {
79     //
80     // create the suite of tests to perform.
81     TestSuite *testSuite = new TestSuite ("FunctionSpaceTestCase");
82    
83     testSuite->addTest (new TestCaller< FunctionSpaceTestCase>("testAll",&FunctionSpaceTestCase::testAll));
84     return testSuite;
85     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26