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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1796 - (hide annotations)
Wed Sep 17 01:45:46 2008 UTC (10 years, 8 months ago) by jfenwick
File size: 2547 byte(s)
Merged noarrayview branch onto trunk.


1 ksteube 1312
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 robwdcock 670 #include "escript/DataEmpty.h"
17     #include "escript/FunctionSpace.h"
18 robwdcock 638 #include "esysUtils/EsysException.h"
19 jgs 82
20     #include "DataEmptyTestCase.h"
21    
22     using namespace CppUnitTest;
23     using namespace escript;
24     using namespace std;
25     using namespace esysUtils;
26    
27     void DataEmptyTestCase::setUp() {
28     //
29     // This is called before each test is run
30    
31     }
32    
33     void DataEmptyTestCase::tearDown() {
34     //
35     // This is called after each test has been run
36    
37     }
38    
39     void DataEmptyTestCase::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 102 cout << "\tTest default constructor." << endl;
49 jgs 82 DataEmpty testData;
50    
51 jgs 102 cout << "\tTest toString method." << endl;
52 jgs 121 assert(testData.toString() == "(Empty Data)");
53 jgs 82
54     try {
55 jgs 102 cout << "\tTest getPointOffset." << endl;
56 jgs 82 assert(testData.getPointOffset(0,0) == 0);
57     assert(false);
58     }
59 phornby 1455 catch (EsysException&) {
60 jgs 102 //cout << e.toString() << endl;
61 jgs 82 assert(true);
62     }
63    
64     try {
65 jgs 102 cout << "\tTest getDataPoint." << endl;
66 jgs 82 // this function also returns a DataArrayView object - should check that
67 jfenwick 1796 testData.getPointOffset(0,0);
68 jgs 82 assert(false);
69     }
70 phornby 1455 catch (EsysException&) {
71 jgs 102 //cout << e.toString() << endl;
72 jgs 82 assert(true);
73     }
74    
75 jgs 102 cout << "\tTest getLength." << endl;
76 jgs 82 assert(testData.getLength() == 0);
77    
78 jfenwick 1796 DataTypes::RegionType region;
79 jgs 82
80     try {
81 jgs 102 cout << "\tTest getSlice." << endl;
82 jgs 82 assert(testData.getSlice(region) == 0);
83     assert(false);
84     }
85 phornby 1455 catch (EsysException&) {
86 jgs 102 //cout << e.toString() << endl;
87 jgs 82 assert(true);
88     }
89    
90     try {
91 jgs 102 cout << "\tTest setSlice." << endl;
92 jgs 82 testData.setSlice(0,region);
93     assert(false);
94     }
95 phornby 1455 catch (EsysException&) {
96 jgs 102 //cout << e.toString() << endl;
97 jgs 82 assert(true);
98     }
99    
100    
101     }
102    
103     TestSuite* DataEmptyTestCase::suite ()
104     {
105     //
106     // create the suite of tests to perform.
107     TestSuite *testSuite = new TestSuite ("DataEmptyTestCase");
108    
109     testSuite->addTest (new TestCaller< DataEmptyTestCase>("testAll",&DataEmptyTestCase::testAll));
110     return testSuite;
111     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26