/[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 1026 by phornby, Tue Mar 13 08:25:00 2007 UTC revision 1325 by matt, Mon Oct 1 06:28:24 2007 UTC
# Line 1  Line 1 
1  // $Id$  
2  /*  /* $Id$ */
3   *****************************************************************************  
4   *                                                                           *  /*******************************************************
5   *       COPYRIGHT  ACcESS  -  All Rights Reserved                           *   *
6   *                                                                           *   *           Copyright 2003-2007 by ACceSS MNRF
7   * This software is the property of ACcESS. No part of this code             *   *       Copyright 2007 by University of Queensland
8   * may be copied in any form or by any means without the expressed written   *   *
9   * consent of ACcESS.  Copying, use or modification of this software         *   *                http://esscc.uq.edu.au
10   * by any unauthorised person is illegal unless that person has a software   *   *        Primary Business: Queensland, Australia
11   * license agreement with ACcESS.                                            *   *  Licensed under the Open Software License version 3.0
12   *                                                                           *   *     http://www.opensource.org/licenses/osl-3.0.php
13   *****************************************************************************   *
14  */   *******************************************************/
15    
16  #include <iostream>  #include <iostream>
17  #if (defined _WIN32) && (defined __INTEL_COMPILER)  #if (defined _WIN32) && (defined __INTEL_COMPILER)
18  #include <mathimf.h>  #include <mathimf.h>
# Line 545  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 590  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.1026  
changed lines
  Added in v.1325

  ViewVC Help
Powered by ViewVC 1.1.26