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

Diff of /branches/RW_WIN32/escript/test/DataAlgorithmAdapterTestCase.cpp

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 106 by jgs, Thu Dec 23 07:20:12 2004 UTC
# Line 40  void DataAlgorithmAdapterTestCase::testA Line 40  void DataAlgorithmAdapterTestCase::testA
40    
41    cout << endl;    cout << endl;
42    
43      cout << "\tSize: " << sizeof(DataAlgorithmAdapter<FMin>) << endl;
44    
45    cout << "\tTesting FMax." << endl;    cout << "\tTesting FMax." << endl;
46    DataAlgorithmAdapter<FMax> myMax(numeric_limits<double>::min());    DataAlgorithmAdapter<FMax> sup(numeric_limits<double>::min());
47    myMax(1);    sup.resetResult();
48    myMax(2);    sup(1);
49    myMax(14);    sup(2);
50    myMax(3);    sup(14);
51    assert(myMax.getResult()==14);    sup(3);
52      assert(sup.getResult()==14);
53    
54    cout << "\tTesting AbsMax." << endl;    cout << "\tTesting AbsMax." << endl;
55    DataAlgorithmAdapter<AbsMax> Lsup(0);    DataAlgorithmAdapter<AbsMax> Lsup(0);
56      Lsup.resetResult();
57    Lsup(-2);    Lsup(-2);
58    Lsup(2);    Lsup(2);
59    Lsup(5);    Lsup(5);
# Line 58  void DataAlgorithmAdapterTestCase::testA Line 62  void DataAlgorithmAdapterTestCase::testA
62    
63    cout << "\tTesting FMin." << endl;    cout << "\tTesting FMin." << endl;
64    DataAlgorithmAdapter<FMin> inf(numeric_limits<double>::max());    DataAlgorithmAdapter<FMin> inf(numeric_limits<double>::max());
65      inf.resetResult();
66    inf(1);    inf(1);
67    inf(12);    inf(12);
68    inf(2);    inf(2);
69    inf(99);    inf(99);
70    assert(inf.getResult()==1);    assert(inf.getResult()==1);
71    
72    cout << "\tSize: " << sizeof(DataAlgorithmAdapter<FMin>) << endl;    cout << "\tTesting Length." << endl;
73      DataAlgorithmAdapter<Length> length(0);
74      length.resetResult();
75      length(2);
76      length(4);
77      length(6);
78      length(8);
79      assert(length.getResult()==std::sqrt(120.0));
80      length.resetResult();
81      length(1.5);
82      length(2.5);
83      length(3.5);
84      length(4.5);
85      assert(length.getResult()==std::sqrt(41.0));
86    
87      cout << "\tTesting Trace." << endl;
88      DataAlgorithmAdapter<Trace> trace(0);
89      trace.resetResult();
90      trace(1);
91      trace(2);
92      trace(3);
93      trace(4);
94      trace(5);
95      assert(trace.getResult()==15);
96      trace.resetResult();
97      trace(1.5);
98      trace(2.5);
99      trace(3.5);
100      trace(4.5);
101      trace(5.5);
102      assert(trace.getResult()==17.5);
103    
104  }  }
105    

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

  ViewVC Help
Powered by ViewVC 1.1.26