|
Boost-Commit : |
From: jefffaust_at_[hidden]
Date: 2007-05-28 19:24:31
Author: jefffaust
Date: 2007-05-28 19:24:31 EDT (Mon, 28 May 2007)
New Revision: 4340
URL: http://svn.boost.org/trac/boost/changeset/4340
Log:
add test to stream iterator range for vector of pair to expose failure case.
Text files modified:
sandbox/explore/libs/explore/test/std_pair.cpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
Modified: sandbox/explore/libs/explore/test/std_pair.cpp
==============================================================================
--- sandbox/explore/libs/explore/test/std_pair.cpp (original)
+++ sandbox/explore/libs/explore/test/std_pair.cpp 2007-05-28 19:24:31 EDT (Mon, 28 May 2007)
@@ -57,6 +57,16 @@
vpi.push_back(pi);
explore::print(vpi, str_out);
BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2], [1, 2], [1, 2]]");
+
+ str_out.str("");
+
+ explore::print(vpi.begin(), ++(++vpi.begin()), str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2], [1, 2]]");
+
+ str_out.str("");
+
+ explore::print(boost::make_iterator_range(vpi.begin(), ++(++vpi.begin())), str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2], [1, 2]]");
}
BOOST_AUTO_TEST_CASE( pair_in_vector_stream_test )
@@ -81,4 +91,9 @@
vpi.push_back(pi);
str_out << vpi;
BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2], [1, 2], [1, 2]]");
+
+ str_out.str("");
+
+ str_out << explore::make_iterator_range(vpi.begin(), ++(++vpi.begin()));
+ BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2], [1, 2]]");
}
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