Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77908 - trunk/libs/container/test
From: igaztanaga_at_[hidden]
Date: 2012-04-11 02:24:10


Author: igaztanaga
Date: 2012-04-11 02:24:09 EDT (Wed, 11 Apr 2012)
New Revision: 77908
URL: http://svn.boost.org/trac/boost/changeset/77908

Log:
Added equal_range and range insertion test prototypes.
Text files modified:
   trunk/libs/container/test/map_test.hpp | 15 +++++++++++----
   trunk/libs/container/test/vector_test.cpp | 4 ++--
   2 files changed, 13 insertions(+), 6 deletions(-)

Modified: trunk/libs/container/test/map_test.hpp
==============================================================================
--- trunk/libs/container/test/map_test.hpp (original)
+++ trunk/libs/container/test/map_test.hpp 2012-04-11 02:24:09 EDT (Wed, 11 Apr 2012)
@@ -387,10 +387,17 @@
                return 1;
             if(!CheckEqualPairContainers(boostmultimap, stdmultimap))
                return 1;
- {
- IntType i1(i);
- IntType i2(i);
- new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ { //Check equal_range
+ std::pair<typename MyBoostMultiMap::iterator, typename MyBoostMultiMap::iterator> bret =
+ boostmultimap->equal_range(boostmultimap->begin()->first);
+
+ std::pair<typename MyStdMultiMap::iterator, typename MyStdMultiMap::iterator> sret =
+ stdmultimap->equal_range(stdmultimap->begin()->first);
+
+ if( std::distance(bret.first, bret.second) !=
+ std::distance(sret.first, sret.second) ){
+ return 1;
+ }
             }
             {
                IntType i1(i);

Modified: trunk/libs/container/test/vector_test.cpp
==============================================================================
--- trunk/libs/container/test/vector_test.cpp (original)
+++ trunk/libs/container/test/vector_test.cpp 2012-04-11 02:24:09 EDT (Wed, 11 Apr 2012)
@@ -94,7 +94,7 @@
 };
 
 int main()
-{/*
+{
    {
       const std::size_t positions_length = 10;
       std::size_t positions[positions_length];
@@ -114,7 +114,7 @@
       for(std::size_t i = 0, max = vector_int.size(); i != max; ++i){
          std::cout << vector_int[i] << std::endl;
       }
- }*/
+ }
    recursive_vector_test();
    {
       //Now test move semantics


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk