Changeset 1027 for trunk/test


Ignore:
Timestamp:
Feb 2, 2008, 10:29:29 PM (15 years ago)
Author:
Peter
Message:

going back to previous design in which view and const_view are in different classes. Having them in same didnt work as expected. There is a problem converting vector::iterator to vector::const_iterator. I'll open a separate ticket for this issue.

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/iterator_test.cc

    r1000 r1027  
    5353  utility::vector::iterator begin=vec.begin();
    5454  // test iterator to const_iterator conversion
     55  ///////////////////////////////////////////////////////
     56  /* const conversion doesn't work for new vector structure
    5557  utility::vector::const_iterator ci = vec.begin();
    5658  ci = begin;
    5759  if (begin!=ci)
    5860    ok = false;
    59  
     61  */ 
     62  ///////////////////////////////////////////////////////
    6063  utility::vector::iterator end=vec.end();
    6164  std::sort(begin, end);
  • trunk/test/vector_test.cc

    r1015 r1027  
    2929#include "yat/utility/utility.h"
    3030#include "yat/utility/vector.h"
     31#include "yat/utility/VectorConstView.h"
    3132#include "yat/utility/VectorView.h"
    3233
     
    6768  shuffle(vec);
    6869  double sum_after = utility::sum(vec);
    69   ok &= (sum_after==sum_before);
     70  if (sum_after!=sum_before){
     71    *message << "shuffle failed" << std::endl;
     72    ok = false;
     73  }
    7074
    7175  // checking that view works
     
    8892    *message << "const view implementation" << std::endl;
    8993    const utility::vector vv(10,3.0);
    90     utility::VectorView vview(vv,0,5,1);
     94    utility::VectorConstView vview(vv,0,5,1);
    9195    // const utility::vector vview(vv,0,5,1); // this is the proper line
    9296    utility::vector vv2(5,2.0);
     
    117121  }
    118122
    119   /* different sizes are allowed in new design
    120123  // checking that assignment operator throws an exception if vectors
    121124  // differ in size
     
    130133    try {
    131134      utility::vector v(vec_view.size()+1,0.0);
    132       v=vec_view;
     135      vec_view=v;
    133136    } catch (utility::GSL_error& err) {
    134137      exception_happens=true;
     
    141144    gsl_set_error_handler(err_handler);
    142145  }
    143   */
    144146
    145147  // checking that assignment operator changes the underlying object when
Note: See TracChangeset for help on using the changeset viewer.