/[escript]/trunk/escript/test/DataTestCase.cpp
ViewVC logotype

Diff of /trunk/escript/test/DataTestCase.cpp

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

revision 1324 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 1325 by matt, Mon Oct 1 06:28:24 2007 UTC
# Line 546  void DataTestCase::testDataTagged() { Line 546  void DataTestCase::testDataTagged() {
546      DataArrayView defaultValue(viewData,viewShape);      DataArrayView defaultValue(viewData,viewShape);
547    
548      bool expanded=false;      bool expanded=false;
549      
550      Data myData(keys,values,defaultValue,FunctionSpace(),expanded);      Data myData(keys,values,defaultValue,FunctionSpace(),expanded);
551    
552      // cout << myData.toString() << endl;      // cout << myData.toString() << endl;
# Line 591  void DataTestCase::testDataTagged() { Line 591  void DataTestCase::testDataTagged() {
591      cout << "\tTest setting of a tag and associated value." << endl;      cout << "\tTest setting of a tag and associated value." << endl;
592    
593      // value for tag "1"      // value for tag "1"
594      DataArray eTwo(defaultValue);      DataArrayView::ValueType eTwoData(viewData);
595      for (int i=0;i<eTwo.getView().getShape()[0];i++) {      DataArrayView eTwoView(eTwoData, viewShape);
596        eTwo.getView()(i)=i+2.0;      for (int i=0;i<eTwoView.getShape()[0];i++) {
597          eTwoView(i)=i+2.0;
598      }      }
599    
600      myData.setTaggedValueFromCPP(1,eTwo.getView());      myData.setTaggedValueFromCPP(1,eTwoView);
601    
602      assert(myData.getLength()==6);      assert(myData.getLength()==6);
603    
604      myDataView = myData.getDataPoint(0,0);      myDataView = myData.getDataPoint(0,0);
605      assert(myDataView==eTwo.getView());      assert(myDataView==eTwoView);
606      assert(!myDataView.isEmpty());      assert(!myDataView.isEmpty());
607      assert(myDataView.getOffset()==3);      assert(myDataView.getOffset()==3);
608      assert(myDataView.getRank()==1);      assert(myDataView.getRank()==1);

Legend:
Removed from v.1324  
changed lines
  Added in v.1325

  ViewVC Help
Powered by ViewVC 1.1.26