/[escript]/branches/schroedinger/escript/test/DataConstantTestCase.cpp
ViewVC logotype

Diff of /branches/schroedinger/escript/test/DataConstantTestCase.cpp

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

revision 1925 by jfenwick, Thu Oct 9 03:09:30 2008 UTC revision 1926 by jfenwick, Fri Oct 24 05:54:08 2008 UTC
# Line 87  void DataConstantTestCase::testAll() { Line 87  void DataConstantTestCase::testAll() {
87    shape.push_back(3);    shape.push_back(3);
88    shape.push_back(21);    shape.push_back(21);
89    
 /*  
   cout << "\tTest reshape." << endl;  
   testData.reshapeDataPoint(shape);  
   assert((unsigned int)testData.getPointDataView().getRank()==shape.size());  
   
   cout << "\tTest getPointDataView." << endl;  
   for (int k=0;k<shape[2];k++) {  
     for (int j=0;j<shape[1];j++) {  
       for (int i=0;i<shape[0];i++) {  
     assert(testData.getPointDataView()(i,j,k)==pointData());  
       }  
     }  
   }  
   
   try {  
     cout << "\tTest illegal reshape." << endl;  
     testData.reshapeDataPoint(shape);  
     assert(false);  
   }  
   catch (EsysException& e) {  
     //cout << e.toString() << endl;  
     assert(true);  
   }  
   
   cout << "\tVerify data point attributes." << endl;  
   DataArrayView dataView=testData.getPointDataView();  
   assert(dataView.getRank()==3);  
   assert(dataView.noValues()==126);  
   assert(dataView.getShape()[0]==2);  
   assert(dataView.getShape()[1]==3);  
   assert(dataView.getShape()[2]==21);  
 */  
   
90    cout << "\tTesting alternative constructor." << endl;    cout << "\tTesting alternative constructor." << endl;
91    DataTypes::ValueType data1(DataTypes::noValues(shape),1.0);    DataTypes::ValueType data1(DataTypes::noValues(shape),1.0);
92    // do not call the FunctionSpace constructor directly    // do not call the FunctionSpace constructor directly
# Line 139  void DataConstantTestCase::testAll() { Line 106  void DataConstantTestCase::testAll() {
106    cout << "\tTest getLength." << endl;    cout << "\tTest getLength." << endl;
107    assert(testData1.getLength()==126);    assert(testData1.getLength()==126);
108    
 //   cout << "\tVerify data point attributes." << endl;  
 // //   DataArrayView dataView=testData1.getPointDataView();  
 //   assert(data.getRank()==3);  
 //   assert(data.getNoValues()==126);  
 //   assert(data.getShape()[0]==2);  
 //   assert(data.getShape()[1]==3);  
 //   assert(data.getShape()[2]==21);  
   
109    cout << "\tTesting copy constructor." << endl;    cout << "\tTesting copy constructor." << endl;
110    DataConstant testData2(testData1);    DataConstant testData2(testData1);
111    
# Line 162  void DataConstantTestCase::testAll() { Line 121  void DataConstantTestCase::testAll() {
121    assert(testData2.getLength()==126);    assert(testData2.getLength()==126);
122    
123    cout << "\tVerify data point attributes." << endl;    cout << "\tVerify data point attributes." << endl;
 //  dataView=testData2.getPointDataView();  
124    assert(testData2.getRank()==3);    assert(testData2.getRank()==3);
125    assert(testData2.getNoValues()==126);    assert(testData2.getNoValues()==126);
126    assert(testData2.getShape()[0]==2);    assert(testData2.getShape()[0]==2);
# Line 189  void DataConstantTestCase::testAll() { Line 147  void DataConstantTestCase::testAll() {
147    assert(testData3->getLength()==126);    assert(testData3->getLength()==126);
148    
149    cout << "\tVerify data point attributes." << endl;    cout << "\tVerify data point attributes." << endl;
 //   dataView=testData3->getPointDataView();  
150    assert(testData3->getRank()==3);    assert(testData3->getRank()==3);
151    assert(testData3->getNoValues()==126);    assert(testData3->getNoValues()==126);
152    assert(testData3->getShape()[0]==2);    assert(testData3->getShape()[0]==2);
# Line 216  void DataConstantTestCase::testAll() { Line 173  void DataConstantTestCase::testAll() {
173    assert(testData4->getLength()==8);    assert(testData4->getLength()==8);
174    
175    cout << "\tVerify data point attributes." << endl;    cout << "\tVerify data point attributes." << endl;
 //   dataView=testData4->getPointDataView();  
176    assert(testData4->getRank()==3);    assert(testData4->getRank()==3);
177    assert(testData4->getNoValues()==8);    assert(testData4->getNoValues()==8);
178    assert(testData4->getShape()[0]==2);    assert(testData4->getShape()[0]==2);

Legend:
Removed from v.1925  
changed lines
  Added in v.1926

  ViewVC Help
Powered by ViewVC 1.1.26