/[escript]/trunk/escript/test/DataAlgorithmAdapter/DataAlgorithmAdapterTestCase.cpp
ViewVC logotype

Diff of /trunk/escript/test/DataAlgorithmAdapter/DataAlgorithmAdapterTestCase.cpp

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

revision 100 by jgs, Wed Dec 15 03:48:48 2004 UTC revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC
# Line 1  Line 1 
1    // $Id$
2  /*  /*
3   *****************************************************************************   *****************************************************************************
4   *                                                                           *   *                                                                           *
# Line 36  void DataAlgorithmAdapterTestCase::tearD Line 37  void DataAlgorithmAdapterTestCase::tearD
37  }  }
38    
39  void DataAlgorithmAdapterTestCase::testAll() {  void DataAlgorithmAdapterTestCase::testAll() {
40    
41    cout << endl;    cout << endl;
42    
43      cout << "\tTesting FMax." << endl;
44    DataAlgorithmAdapter<FMax> myMax(numeric_limits<double>::min());    DataAlgorithmAdapter<FMax> myMax(numeric_limits<double>::min());
45    myMax(1);    myMax(1);
46    myMax(2);    myMax(2);
47      myMax(14);
48    myMax(3);    myMax(3);
49    assert(myMax.getResult()==3);    assert(myMax.getResult()==14);
50    DataAlgorithmAdapter<AbsMax> Lsup(numeric_limits<double>::min());  
51      cout << "\tTesting AbsMax." << endl;
52      DataAlgorithmAdapter<AbsMax> Lsup(0);
53    Lsup(-2);    Lsup(-2);
54    Lsup(2);    Lsup(2);
55    Lsup(5);    Lsup(5);
56    Lsup(-1000);    Lsup(-10);
57    assert(Lsup.getResult()==1000);    assert(Lsup.getResult()==10);
58    
59      cout << "\tTesting FMin." << endl;
60    DataAlgorithmAdapter<FMin> inf(numeric_limits<double>::max());    DataAlgorithmAdapter<FMin> inf(numeric_limits<double>::max());
61    inf(1);    inf(1);
62      inf(12);
63    inf(2);    inf(2);
64    assert(inf.getResult() == 1);    inf(99);
65    cout << "Size: " << sizeof(DataAlgorithmAdapter<FMin>) << endl;    assert(inf.getResult()==1);
66    
67      cout << "\tSize: " << sizeof(DataAlgorithmAdapter<FMin>) << endl;
68    
69  }  }
70    
71  TestSuite* DataAlgorithmAdapterTestCase::suite ()  TestSuite* DataAlgorithmAdapterTestCase::suite ()

Legend:
Removed from v.100  
changed lines
  Added in v.102

  ViewVC Help
Powered by ViewVC 1.1.26