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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3596 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 3597 by caltinay, Thu Sep 15 06:03:17 2011 UTC
# Line 12  Line 12 
12  *******************************************************/  *******************************************************/
13    
14    
15    #include "FunctionSpaceTestCase.h"
16    
17  #include "escript/FunctionSpace.h"  #include "escript/FunctionSpace.h"
18  #include "escript/NullDomain.h"  #include "escript/NullDomain.h"
19    
20  #include "FunctionSpaceTestCase.h"  #include <cppunit/TestCaller.h>
   
21  #include <iostream>  #include <iostream>
22  #include <sstream>  #include <sstream>
23    
24  using namespace CppUnitTest;  using namespace CppUnit;
25  using namespace escript;  using namespace escript;
26  using namespace std;  using namespace std;
27    
 void FunctionSpaceTestCase::setUp() {  
   //  
   // This is called before each test is run  
   
 }  
   
 void FunctionSpaceTestCase::tearDown() {  
   //  
   // This is called after each test has been run  
   
 }  
   
 void FunctionSpaceTestCase::testAll() {  
   //  
   // The test code may be entered here  
   // There is nothing special about the function name, it may be renamed to  
   // something more suitable.  
   // As many test methods as desired may be added.  
28    
29    void FunctionSpaceTestCase::testAll()
30    {
31    cout << endl;    cout << endl;
   
32    cout << "\tTest default FunctionSpace constructor." << endl;    cout << "\tTest default FunctionSpace constructor." << endl;
33    
34    // Test Default constructor    // Test Default constructor
35    FunctionSpace testFunctionSpace0;    FunctionSpace testFunctionSpace0;
36    FunctionSpace testFunctionSpace1;    FunctionSpace testFunctionSpace1;
37    
38    assert(testFunctionSpace0==testFunctionSpace1);    CPPUNIT_ASSERT(testFunctionSpace0==testFunctionSpace1);
39    
40    cout << "\tTest FunctionSpace constructor." << endl;    cout << "\tTest FunctionSpace constructor." << endl;
41    
# Line 62  void FunctionSpaceTestCase::testAll() { Line 46  void FunctionSpaceTestCase::testAll() {
46    
47    FunctionSpace testFunctionSpace2(nulldom, testfunctionSpaceType);    FunctionSpace testFunctionSpace2(nulldom, testfunctionSpaceType);
48        
49    assert(testFunctionSpace1.getTypeCode()==testfunctionSpaceType);    CPPUNIT_ASSERT(testFunctionSpace1.getTypeCode()==testfunctionSpaceType);
50    assert(*(testFunctionSpace2.getDomain())==*nullDomain);    CPPUNIT_ASSERT(*(testFunctionSpace2.getDomain())==*nullDomain);
51    assert(testFunctionSpace1.getDim()==1);    CPPUNIT_ASSERT(testFunctionSpace1.getDim()==1);
52    assert(testFunctionSpace1==testFunctionSpace1);    CPPUNIT_ASSERT(testFunctionSpace1==testFunctionSpace1);
53    assert(!(testFunctionSpace1!=testFunctionSpace1));    CPPUNIT_ASSERT(!(testFunctionSpace1!=testFunctionSpace1));
54    
55    FunctionSpace testFunctionSpace3=testFunctionSpace2;  // test copy constructor    FunctionSpace testFunctionSpace3=testFunctionSpace2;  // test copy constructor
56  cout << "Testing equality\n";  cout << "Testing equality\n";
57    assert(testFunctionSpace3==testFunctionSpace2);    CPPUNIT_ASSERT(testFunctionSpace3==testFunctionSpace2);
   
58  }  }
59    
60  TestSuite* FunctionSpaceTestCase::suite ()  TestSuite* FunctionSpaceTestCase::suite()
61  {  {
62    //    TestSuite *testSuite = new TestSuite("FunctionSpaceTestCase");
   // create the suite of tests to perform.  
   TestSuite *testSuite = new TestSuite ("FunctionSpaceTestCase");  
63    
64    testSuite->addTest (new TestCaller< FunctionSpaceTestCase>("testAll",&FunctionSpaceTestCase::testAll));    testSuite->addTest(new TestCaller<FunctionSpaceTestCase>(
65                  "testAll",&FunctionSpaceTestCase::testAll));
66    return testSuite;    return testSuite;
67  }  }
68    

Legend:
Removed from v.3596  
changed lines
  Added in v.3597

  ViewVC Help
Powered by ViewVC 1.1.26