/[escript]/branches/escript3047_with_pastix2995/escript/test/DataAlgorithmAdapterTestCase.cpp
ViewVC logotype

Contents of /branches/escript3047_with_pastix2995/escript/test/DataAlgorithmAdapterTestCase.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (show annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years, 1 month ago) by jgs
Original Path: trunk/esys2/escript/test/DataAlgorithmAdapter/DataAlgorithmAdapterTestCase.cpp
File size: 2171 byte(s)
Initial revision

1 /*
2 *****************************************************************************
3 * *
4 * COPYRIGHT ACcESS - All Rights Reserved *
5 * *
6 * This software is the property of ACcESS. No part of this code *
7 * may be copied in any form or by any means without the expressed written *
8 * consent of ACcESS. Copying, use or modification of this software *
9 * by any unauthorised person is illegal unless that person has a software *
10 * license agreement with ACcESS. *
11 * *
12 *****************************************************************************
13 */
14 #include "escript/Data/DataAlgorithm.h"
15 #include "DataAlgorithmAdapterTestCase.h"
16
17 #include <iostream>
18 #include <algorithm>
19 #include <math.h>
20 #include <limits>
21
22 using namespace CppUnitTest;
23 using namespace std;
24 using namespace escript;
25
26 void DataAlgorithmAdapterTestCase::setUp() {
27 //
28 // This is called before each test is run
29
30 }
31
32 void DataAlgorithmAdapterTestCase::tearDown() {
33 //
34 // This is called after each test has been run
35
36 }
37
38 void DataAlgorithmAdapterTestCase::testAll() {
39 cout << endl;
40 DataAlgorithmAdapter<FMax> myMax(numeric_limits<double>::min());
41 myMax(1);
42 myMax(2);
43 myMax(3);
44 assert(myMax.getResult()==3);
45 DataAlgorithmAdapter<AbsMax> Lsup(numeric_limits<double>::min());
46 Lsup(-2);
47 Lsup(2);
48 Lsup(5);
49 Lsup(-1000);
50 assert(Lsup.getResult()==1000);
51 DataAlgorithmAdapter<FMin> inf(numeric_limits<double>::max());
52 inf(1);
53 inf(2);
54 assert(inf.getResult() == 1);
55 cout << "Size: " << sizeof(DataAlgorithmAdapter<FMin>) << endl;
56 }
57
58 TestSuite* DataAlgorithmAdapterTestCase::suite ()
59 {
60 //
61 // create the suite of tests to perform.
62 TestSuite *testSuite = new TestSuite ("DataAlgorithmAdapterTestCase");
63
64 testSuite->addTest (new TestCaller< DataAlgorithmAdapterTestCase>("testAll",&DataAlgorithmAdapterTestCase::testAll));
65 return testSuite;
66 }
67

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26