/[escript]/branches/arrayview_from_1695_trunk/escript/test/DataArrayViewTestCase.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/test/DataArrayViewTestCase.cpp

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

trunk/escript/test/DataArrayView/DataArrayViewTestCase.cpp revision 468 by jgs, Wed Jan 25 06:50:39 2006 UTC trunk/escript/test/DataArrayViewTestCase.cpp revision 710 by gross, Wed Apr 26 22:22:16 2006 UTC
# Line 11  Line 11 
11   *                                                                           *   *                                                                           *
12   *****************************************************************************   *****************************************************************************
13  */  */
14  #include "escript/Data/DataArray.h"  #include "escript/DataArray.h"
15  #include "escript/Data/DataArrayView.h"  #include "escript/DataArrayView.h"
16  #include "escript/Data/DataAlgorithm.h"  #include "escript/DataAlgorithm.h"
17  #include "EsysException.h"  #include "esysUtils/EsysException.h"
18    
19  #include "DataArrayViewTestCase.h"  #include "DataArrayViewTestCase.h"
20    
# Line 1582  void DataArrayViewTestCase::testAll() Line 1582  void DataArrayViewTestCase::testAll()
1582    
1583    }    }
1584    
1585      #if defined DOASSERT
1586    {    {
1587      cout << endl;      cout << endl;
1588      cout << "\tTest too many indices for shape exception.";      cout << "\tTest too many indices for shape exception.";
# Line 1626  void DataArrayViewTestCase::testAll() Line 1627  void DataArrayViewTestCase::testAll()
1627      }      }
1628    
1629    }    }
1630      #endif
1631    
1632      #if defined DOASSERT
1633    {    {
1634      cout << endl;      cout << endl;
1635      cout << "\tTest invalid index exception.";      cout << "\tTest invalid index exception.";
# Line 1644  void DataArrayViewTestCase::testAll() Line 1647  void DataArrayViewTestCase::testAll()
1647        assert(true);        assert(true);
1648      }      }
1649    }    }
1650      #endif
1651    
1652    {    {
1653      cout << endl;      cout << endl;
# Line 1789  void DataArrayViewTestCase::testUnaryOp( Line 1793  void DataArrayViewTestCase::testUnaryOp(
1793        // check the results        // check the results
1794        for (int i=0;i<shape[0];i++) {        for (int i=0;i<shape[0];i++) {
1795          for (int j=0;j<shape[1];j++) {          for (int j=0;j<shape[1];j++) {
1796            assert(dataView(i,j)==std::sqrt((double)dataView.index(i,j)));            assert(std::abs(dataView(i,j)-std::sqrt((double)dataView.index(i,j)))<1.e-10);
1797          }          }
1798        }        }
1799    

Legend:
Removed from v.468  
changed lines
  Added in v.710

  ViewVC Help
Powered by ViewVC 1.1.26