/[escript]/branches/more_shared_ptrs_from_1812/escript/test/FunctionSpaceTestCase.cpp
ViewVC logotype

Contents of /branches/more_shared_ptrs_from_1812/escript/test/FunctionSpaceTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1821 - (show annotations)
Wed Oct 1 04:46:59 2008 UTC (10 years, 9 months ago) by jfenwick
File size: 2243 byte(s)
Branch commit.
Fixed some issues.
runs c++ unit tests and run_simplesolve successfully.


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * 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
14
15 #include "escript/FunctionSpace.h"
16 #include "escript/NullDomain.h"
17
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 cout << "\tTest default FunctionSpace constructor." << endl;
49
50 // Test Default constructor
51 FunctionSpace testFunctionSpace0;
52 FunctionSpace testFunctionSpace1;
53
54 assert(testFunctionSpace0==testFunctionSpace1);
55
56 cout << "\tTest FunctionSpace constructor." << endl;
57
58 // Test constructor
59 NullDomain* nullDomain=new NullDomain(); // the shared ptr will deal with it
60 int testfunctionSpaceType = nullDomain->getFunctionCode();
61
62 FunctionSpace testFunctionSpace2(*nullDomain, testfunctionSpaceType);
63
64 assert(testFunctionSpace1.getTypeCode()==testfunctionSpaceType);
65 assert(*(testFunctionSpace2.getDomain())==*nullDomain);
66 assert(testFunctionSpace1.getDim()==1);
67 assert(testFunctionSpace1==testFunctionSpace1);
68 assert(!(testFunctionSpace1!=testFunctionSpace1));
69
70 testFunctionSpace1=testFunctionSpace2;
71 assert(testFunctionSpace1==testFunctionSpace2);
72
73 }
74
75 TestSuite* FunctionSpaceTestCase::suite ()
76 {
77 //
78 // create the suite of tests to perform.
79 TestSuite *testSuite = new TestSuite ("FunctionSpaceTestCase");
80
81 testSuite->addTest (new TestCaller< FunctionSpaceTestCase>("testAll",&FunctionSpaceTestCase::testAll));
82 return testSuite;
83 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26