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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3597 - (show annotations)
Thu Sep 15 06:03:17 2011 UTC (7 years, 7 months ago) by caltinay
File size: 1994 byte(s)
Switching to external cppunit:
-removed tools/CppUnitTest
-updated scons script and files
-updated tests to changed API
-updated readme

Bumped scons options file version to 201. Additions:
-cppunit*
-boomeramg*
-vsl_random


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 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 "FunctionSpaceTestCase.h"
16
17 #include "escript/FunctionSpace.h"
18 #include "escript/NullDomain.h"
19
20 #include <cppunit/TestCaller.h>
21 #include <iostream>
22 #include <sstream>
23
24 using namespace CppUnit;
25 using namespace escript;
26 using namespace std;
27
28
29 void FunctionSpaceTestCase::testAll()
30 {
31 cout << endl;
32 cout << "\tTest default FunctionSpace constructor." << endl;
33
34 // Test Default constructor
35 FunctionSpace testFunctionSpace0;
36 FunctionSpace testFunctionSpace1;
37
38 CPPUNIT_ASSERT(testFunctionSpace0==testFunctionSpace1);
39
40 cout << "\tTest FunctionSpace constructor." << endl;
41
42 // Test constructor
43 NullDomain* nullDomain=new NullDomain(); // the shared ptr will deal with it
44 int testfunctionSpaceType = nullDomain->getFunctionCode();
45 Domain_ptr nulldom(nullDomain);
46
47 FunctionSpace testFunctionSpace2(nulldom, testfunctionSpaceType);
48
49 CPPUNIT_ASSERT(testFunctionSpace1.getTypeCode()==testfunctionSpaceType);
50 CPPUNIT_ASSERT(*(testFunctionSpace2.getDomain())==*nullDomain);
51 CPPUNIT_ASSERT(testFunctionSpace1.getDim()==1);
52 CPPUNIT_ASSERT(testFunctionSpace1==testFunctionSpace1);
53 CPPUNIT_ASSERT(!(testFunctionSpace1!=testFunctionSpace1));
54
55 FunctionSpace testFunctionSpace3=testFunctionSpace2; // test copy constructor
56 cout << "Testing equality\n";
57 CPPUNIT_ASSERT(testFunctionSpace3==testFunctionSpace2);
58 }
59
60 TestSuite* FunctionSpaceTestCase::suite()
61 {
62 TestSuite *testSuite = new TestSuite("FunctionSpaceTestCase");
63
64 testSuite->addTest(new TestCaller<FunctionSpaceTestCase>(
65 "testAll",&FunctionSpaceTestCase::testAll));
66 return testSuite;
67 }
68

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26