Changeset 3372


Ignore:
Timestamp:
Feb 11, 2015, 2:31:03 AM (7 years ago)
Author:
Peter
Message:

Fix bug in CigarIterator? that assumed BASE could be constructed from
NULL. Extend test to avoid regression.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/cigar_iterator.cc

    r3336 r3372  
    3030
    3131#include <cassert>
     32#include <deque>
     33#include <vector>
    3234
    3335using namespace theplu::yat;
     
    8789  }
    8890
    89   utility::CigarIterator<Base> iter3(cigar.begin());
     91  // check default constructor
     92  utility::CigarIterator<Base> iter3;
     93  // check assignment
     94  iter3 = utility::CigarIterator<Base>(cigar.begin());
    9095  utility::CigarIterator<Base> iter4(cigar.begin()+3, 1);
    9196  std::advance(iter3, oplen[0]+oplen[1]+oplen[2]+1);
     
    98103    test::test_readable_iterator(iter3);
    99104    test::test_bidirectional_traversal_iterator(iter3);
     105    // test default constructor
     106    utility::CigarIterator<std::deque<uint32_t>::const_iterator> iter5;
     107    test::avoid_compiler_warning(iter5);
    100108  }
    101109}
  • trunk/yat/utility/CigarIterator.h

    r3370 r3372  
    9494
    9595  template<typename BASE>
    96   CigarIterator<BASE>::CigarIterator(void)
    97     : base_(NULL) {}
     96  CigarIterator<BASE>::CigarIterator(void) {}
    9897
    9998
Note: See TracChangeset for help on using the changeset viewer.