/[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

trunk/esys2/escript/test/Data/DataTestCase.cpp revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC trunk/escript/test/Data/DataTestCase.cpp revision 311 by jgs, Mon Dec 5 02:59:54 2005 UTC
# Line 422  void DataTestCase::testOperations() { Line 422  void DataTestCase::testOperations() {
422    result.copy(base.tan());    result.copy(base.tan());
423    assert(true);    assert(true);
424    
425      cout << "\tTest Data::asin." << endl;
426      result.copy(base.asin());
427      assert(true);
428    
429      cout << "\tTest Data::acos." << endl;
430      result.copy(base.acos());
431      assert(true);
432    
433      cout << "\tTest Data::atan." << endl;
434      result.copy(base.atan());
435      assert(true);
436    
437      cout << "\tTest Data::sinh." << endl;
438      result.copy(base.sinh());
439      assert(true);
440    
441      cout << "\tTest Data::cosh." << endl;
442      result.copy(base.cosh());
443      assert(true);
444    
445      cout << "\tTest Data::tanh." << endl;
446      result.copy(base.tanh());
447      assert(true);
448    
449      cout << "\tTest Data::asinh." << endl;
450      result.copy(base.asinh());
451      assert(true);
452    
453      cout << "\tTest Data::acosh." << endl;
454      result.copy(base.acosh());
455      assert(true);
456    
457      cout << "\tTest Data::atanh." << endl;
458      result.copy(base.atanh());
459      assert(true);
460    
461    cout << "\tTest Data::log." << endl;    cout << "\tTest Data::log." << endl;
462    result.copy(base.log());    result.copy(base.log());
463    assert(true);    assert(true);
464    
465    cout << "\tTest Data::ln." << endl;    //cout << "\tTest Data::ln." << endl;
466    result.copy(base.ln());    //result.copy(base.ln());
467    assert(true);    //assert(true);
468    
469    cout << "\tTest Data::abs." << endl;    cout << "\tTest Data::abs." << endl;
470    result.copy(base.abs());    result.copy(base.abs());
# Line 479  void DataTestCase::testOperations() { Line 515  void DataTestCase::testOperations() {
515    result.copy(base.maxval());    result.copy(base.maxval());
516    assert(result.getPointDataView()() == 5);    assert(result.getPointDataView()() == 5);
517    
518    cout << "\tTest Data::length." << endl;    //cout << "\tTest Data::length." << endl;
519    result.copy(base.length());    //result.copy(base.length());
520    assert(pow(result.getPointDataView()(),2.0) == 55);    //assert(pow(result.getPointDataView()(),2.0) == 55);
521    
522    cout << "\tTest Data::trace." << endl;    cout << "\tTest Data::trace." << endl;
523    result.copy(base.trace());    result.copy(base.trace());
# Line 564  void DataTestCase::testRefValue() { Line 600  void DataTestCase::testRefValue() {
600    
601  }  }
602    
603    void DataTestCase::testMemAlloc() {
604    
605      //
606      // Simple little sanity check for the memory allocator
607    
608      cout << endl;
609    
610      Data *testData;
611      for (int i=0; i<1000; i++) {
612        testData = new Data(0.0, DataArrayView::ShapeType(), FunctionSpace(), true);
613        delete testData;
614      }
615    
616      DataArrayView::ShapeType viewShape;
617      viewShape.push_back(10);
618      viewShape.push_back(10);
619      viewShape.push_back(10);
620    
621      Data *testData2;
622      Data *testData3 = new Data(0.0, viewShape, FunctionSpace(), true);
623      for (int i=0; i<1000; i++) {
624        testData2 = new Data(0.0, viewShape, FunctionSpace(), true);
625        delete testData2;
626      }
627      delete testData3;
628    
629    }
630    
631  TestSuite* DataTestCase::suite ()  TestSuite* DataTestCase::suite ()
632  {  {
633    //    //
# Line 579  TestSuite* DataTestCase::suite () Line 643  TestSuite* DataTestCase::suite ()
643    testSuite->addTest (new TestCaller< DataTestCase>("testSlicing",&DataTestCase::testSlicing));    testSuite->addTest (new TestCaller< DataTestCase>("testSlicing",&DataTestCase::testSlicing));
644    testSuite->addTest (new TestCaller< DataTestCase>("testOperations",&DataTestCase::testOperations));    testSuite->addTest (new TestCaller< DataTestCase>("testOperations",&DataTestCase::testOperations));
645    //testSuite->addTest (new TestCaller< DataTestCase>("testRefValue",&DataTestCase::testRefValue));    //testSuite->addTest (new TestCaller< DataTestCase>("testRefValue",&DataTestCase::testRefValue));
646      testSuite->addTest (new TestCaller< DataTestCase>("testMemAlloc",&DataTestCase::testMemAlloc));
647    
648    return testSuite;    return testSuite;
649  }  }

Legend:
Removed from v.123  
changed lines
  Added in v.311

  ViewVC Help
Powered by ViewVC 1.1.26