Changeset 2362


Ignore:
Timestamp:
Dec 5, 2010, 3:23:53 AM (12 years ago)
Author:
Peter
Message:

more tests for SegmentMap?. closes #640

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/segment_test.cc

    r2360 r2362  
    219219  suite.add(map.find(1.5) != map.end());
    220220  suite.add(map.find(1.5)->second == "foofana");
     221
     222  Map::iterator i = map.begin();
     223  i = map.end();
     224  const Map const_map(map);
     225  Map::const_iterator ci = const_map.begin();
     226  ci = const_map.end();
     227
     228  suite.add(map.size()==1);
     229  map.clear();
     230  suite.add(map.empty()==true);
     231  suite.add(map.size()==0);
     232  map = const_map;
     233  suite.add(map.size()==1);
     234  suite.add(const_map.count(1.0)==1);
     235  suite.add(const_map.count(0.0)==0);
     236  suite.add(const_map.empty()==false);
     237  suite.add(const_map.find(1.0)==const_map.begin());
     238  suite.add(const_map.find(30.0)==const_map.end());
     239  ci = const_map.lower_bound(0.0);
     240  ci = const_map.upper_bound(0.0);
     241  i = map.lower_bound(0.0);
     242  i = map.upper_bound(0.0);
     243 
    221244}
    222245
  • trunk/yat/utility/SegmentMap.h

    r2360 r2362  
    5151    typedef Tp mapped_type;
    5252   
    53 
    5453    /**
    5554       \brief creates a set with no segments
  • trunk/yat/utility/SegmentTree.h

    r2361 r2362  
    127127
    128128    /**
    129        \brief insert set
     129       \brief insert value
    130130
    131131       if \a segment does not overlap with any segment in set, insert
     
    138138     */
    139139    std::pair<iterator, bool> insert(const value_type& segment);
    140 
    141     /**
    142        insert \a segment into set. If there is no gap between \a
    143        segment and neighboring segments the segments are merged.
    144      */
    145     const_iterator insert_merge(const value_type& segment);
    146140
    147141    /**
Note: See TracChangeset for help on using the changeset viewer.