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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3597 - (show annotations)
Thu Sep 15 06:03:17 2011 UTC (8 years, 2 months ago) by caltinay
File size: 1695 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 #include "DataEmptyTestCase.h"
15
16 #include "escript/DataEmpty.h"
17 #include "escript/FunctionSpace.h"
18 #include "esysUtils/EsysException.h"
19
20 #include <cppunit/TestCaller.h>
21
22 using namespace CppUnit;
23 using namespace escript;
24 using namespace std;
25 using namespace esysUtils;
26
27 void DataEmptyTestCase::testAll()
28 {
29 cout << endl;
30 cout << "\tTest default constructor." << endl;
31 DataEmpty testData;
32
33 cout << "\tTest toString method." << endl;
34 CPPUNIT_ASSERT(testData.toString() == "(Empty Data)");
35
36 cout << "\tTest getPointOffset." << endl;
37 CPPUNIT_ASSERT_THROW(testData.getPointOffset(0,0), EsysException);
38
39 cout << "\tTest getDataPoint." << endl;
40 CPPUNIT_ASSERT_THROW(testData.getPointOffset(0,0), EsysException);
41
42 cout << "\tTest getLength." << endl;
43 CPPUNIT_ASSERT(testData.getLength() == 0);
44
45 DataTypes::RegionType region;
46
47 cout << "\tTest getSlice." << endl;
48 CPPUNIT_ASSERT_THROW(testData.getSlice(region), EsysException);
49
50 cout << "\tTest setSlice." << endl;
51 CPPUNIT_ASSERT_THROW(testData.setSlice(0,region), EsysException);
52 }
53
54 TestSuite* DataEmptyTestCase::suite()
55 {
56 TestSuite *testSuite = new TestSuite("DataEmptyTestCase");
57
58 testSuite->addTest(new TestCaller<DataEmptyTestCase>(
59 "testAll",&DataEmptyTestCase::testAll));
60 return testSuite;
61 }
62

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26