/[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 2053 by phornby, Mon Nov 17 11:24:40 2008 UTC revision 2105 by jfenwick, Fri Nov 28 01:52:12 2008 UTC
# Line 93  void DataTestCase::testCopyingWorker(boo Line 93  void DataTestCase::testCopyingWorker(boo
93    {    {
94      cout << "\tTest deep copy " << strs[k] << endl;      cout << "\tTest deep copy " << strs[k] << endl;
95      Data* d=dats[k];      Data* d=dats[k];
96      Data* deep=d->copySelf();   // test self copy      Data deep=d->copySelf();    // test self copy
97      if (delayed)      if (delayed)
98      {      {
99        assert(deep->isLazy());        assert(deep.isLazy());
100      }      }
101      for (int i=0;i<DataTypes::noValues(shape);++i)      for (int i=0;i<DataTypes::noValues(shape);++i)
102      {      {
103      if (d->getDataAtOffset(i)!=deep->getDataAtOffset(i))      if (d->getDataAtOffset(i)!=deep.getDataAtOffset(i))
104          assert(false);          assert(false);
105      }      }
106      if (delayed)      if (delayed)
# Line 114  void DataTestCase::testCopyingWorker(boo Line 114  void DataTestCase::testCopyingWorker(boo
114      }      }
115      for (int i=0;i<DataTypes::noValues(shape);++i)      for (int i=0;i<DataTypes::noValues(shape);++i)
116      {      {
117      if (d->getDataAtOffset(i)==deep->getDataAtOffset(i))      if (d->getDataAtOffset(i)==deep.getDataAtOffset(i))
118          assert(false);          assert(false);
119      }      }
120          if (delayed)          if (delayed)
121      {      {
122         d->delaySelf();         d->delaySelf();
123         deep->delaySelf();         deep.delaySelf();
124      }      }
125      d->copy(*deep);         // test copy from object      d->copy(deep);          // test copy from object
126      if (delayed)      if (delayed)
127      {      {
128        assert(d->isLazy());        assert(d->isLazy());
129      }      }
130      for (int i=0;i<DataTypes::noValues(shape);++i)      for (int i=0;i<DataTypes::noValues(shape);++i)
131      {      {
132      if (d->getDataAtOffset(i)!=deep->getDataAtOffset(i))      if (d->getDataAtOffset(i)!=deep.getDataAtOffset(i))
133          assert(false);          assert(false);
134      }      }
135      d->setToZero();      d->setToZero();
136      for (int i=0;i<DataTypes::noValues(shape);++i)      for (int i=0;i<DataTypes::noValues(shape);++i)
137      {      {
138      if (d->getDataAtOffset(i)==deep->getDataAtOffset(i))      if (d->getDataAtOffset(i)==deep.getDataAtOffset(i))
139          assert(false);          assert(false);
140      }      }
     delete deep;  
141      delete dats[k];      delete dats[k];
142    }    }
143    

Legend:
Removed from v.2053  
changed lines
  Added in v.2105

  ViewVC Help
Powered by ViewVC 1.1.26