/[escript]/trunk/esys2/escript/test/DataExpanded/DataExpandedTestCase.cpp
ViewVC logotype

Diff of /trunk/esys2/escript/test/DataExpanded/DataExpandedTestCase.cpp

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

revision 110 by jgs, Mon Feb 14 04:14:42 2005 UTC revision 119 by jgs, Tue Apr 12 04:45:05 2005 UTC
# Line 71  void DataExpandedTestCase::testAll() { Line 71  void DataExpandedTestCase::testAll() {
71    assert(dataView.getRank()==shape.size());    assert(dataView.getRank()==shape.size());
72    assert(dataView.noValues()==shape[0]*1);    assert(dataView.noValues()==shape[0]*1);
73    assert(dataView.getShape()[0]==shape[0]);    assert(dataView.getShape()[0]==shape[0]);
74      assert(testData.getNumDPPSample()==1);
75      assert(testData.getNumSamples()==1);
76      assert(testData.validSamplePointNo(testData.getNumDPPSample()-1));
77      assert(testData.validSampleNo(testData.getNumSamples()-1));
78    
79      //
80      // Test alternative constructor
81      cout << "\tTest DataExpanded alternative constructor." << endl;
82      data[0]=0.0;
83      data[1]=1.0;
84      data[2]=2.0;
85      DataExpanded testData1(FunctionSpace(),shape,data);
86    
87      cout << "\tTest getLength." << endl;
88      assert(testData1.getLength()==pointData.noValues());
89    
90      cout << "\tTest getPointDataView." << endl;
91      for (int i=0;i<testData1.getPointDataView().getShape()[0];i++) {
92          assert(testData1.getPointDataView()(i)==pointData(i));
93      }
94    
95      cout << "\tVerify data point attributes." << endl;
96      dataView=testData1.getPointDataView();
97      assert(dataView.getRank()==shape.size());
98      assert(dataView.noValues()==shape[0]*1);
99      assert(dataView.getShape()[0]==shape[0]);
100      assert(testData.getNumDPPSample()==1);
101      assert(testData.getNumSamples()==1);
102      assert(testData.validSamplePointNo(testData.getNumDPPSample()-1));
103      assert(testData.validSampleNo(testData.getNumSamples()-1));
104    
105    //    //
106    // Test copy constructor    // Test copy constructor
# Line 90  void DataExpandedTestCase::testAll() { Line 120  void DataExpandedTestCase::testAll() {
120    assert(dataView.getRank()==shape.size());    assert(dataView.getRank()==shape.size());
121    assert(dataView.noValues()==shape[0]*1);    assert(dataView.noValues()==shape[0]*1);
122    assert(dataView.getShape()[0]==shape[0]);    assert(dataView.getShape()[0]==shape[0]);
123      assert(testData2.getNumDPPSample()==1);
124      assert(testData2.getNumSamples()==1);
125      assert(testData2.validSamplePointNo(testData2.getNumDPPSample()-1));
126      assert(testData2.validSampleNo(testData2.getNumSamples()-1));
127    
128  }  }
129    
# Line 141  void DataExpandedTestCase::testReshape() Line 175  void DataExpandedTestCase::testReshape()
175    assert(dataView.getShape()[0]==shape[0]);    assert(dataView.getShape()[0]==shape[0]);
176    assert(dataView.getShape()[1]==shape[1]);    assert(dataView.getShape()[1]==shape[1]);
177    assert(dataView.getShape()[2]==shape[2]);    assert(dataView.getShape()[2]==shape[2]);
178      assert(testData.getNumDPPSample()==1);
179      assert(testData.getNumSamples()==1);
180      assert(testData.validSamplePointNo(testData.getNumDPPSample()-1));
181      assert(testData.validSampleNo(testData.getNumSamples()-1));
182    
183    //    //
184    // Test reshape - illegal    // Test reshape - illegal

Legend:
Removed from v.110  
changed lines
  Added in v.119

  ViewVC Help
Powered by ViewVC 1.1.26