Boost logo

Boost-Commit :

From: jared_at_[hidden]
Date: 2007-05-26 19:59:42


Author: jared
Date: 2007-05-26 19:59:42 EDT (Sat, 26 May 2007)
New Revision: 4296
URL: http://svn.boost.org/trac/boost/changeset/4296

Log:
Test printing passing iterators.

Text files modified:
   sandbox/explore/libs/explore/test/std_vector.cpp | 41 ++++++++++++++++++++++++++++++++++++++++
   1 files changed, 41 insertions(+), 0 deletions(-)

Modified: sandbox/explore/libs/explore/test/std_vector.cpp
==============================================================================
--- sandbox/explore/libs/explore/test/std_vector.cpp (original)
+++ sandbox/explore/libs/explore/test/std_vector.cpp 2007-05-26 19:59:42 EDT (Sat, 26 May 2007)
@@ -9,6 +9,7 @@
 
 #define BOOST_TEST_MODULE PrintLib
 #include <boost/test/unit_test.hpp>
+#include <boost/range/iterator_range.hpp>
 #include <string>
 #include <sstream>
 #include <vector>
@@ -35,6 +36,16 @@
     vi.push_back(3);
     explore::print(vi, str_out);
     BOOST_CHECK_EQUAL(str_out.str(), "[1, 2, 3]");
+
+ str_out.str("");
+
+ explore::print(vi.begin(), ++(++vi.begin()), str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "[1, 2]");
+
+ //str_out.str("");
+
+ //explore::print(boost::make_iterator_range(vi.begin(), ++(++vi.begin())), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[1, 2]");
 }
 
 BOOST_AUTO_TEST_CASE( basic_vector_stream_test )
@@ -58,6 +69,16 @@
     vi.push_back(3);
     str_out << vi;
     BOOST_CHECK_EQUAL(str_out.str(), "[1, 2, 3]");
+
+ //str_out.str("");
+
+ //explore::print(vi.begin(), ++(++vi.begin()), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[1, 2]");
+
+ //str_out.str("");
+
+ //explore::print(boost::make_iterator_range(vi.begin(), ++(++vi.begin())), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[1, 2]");
 }
 
 BOOST_AUTO_TEST_CASE( vector_in_vector_print_test )
@@ -85,6 +106,16 @@
     vvi.push_back(vi);
     explore::print(vvi, str_out);
     BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3], [1, 2, 3]]");
+
+ str_out.str("");
+
+ explore::print(vvi.begin(), ++(++vvi.begin()), str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3]]");
+
+ //str_out.str("");
+
+ //explore::print(boost::make_iterator_range(vvi.begin(), ++(++vvi.begin())), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3]]");
 }
 
 BOOST_AUTO_TEST_CASE( vector_in_vector_stream_test )
@@ -113,6 +144,16 @@
     vvi.push_back(vi);
     str_out << vvi;
     BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3], [1, 2, 3]]");
+
+ //str_out.str("");
+
+ //explore::print(vvi.begin(), ++(++vvi.begin()), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3]]");
+
+ //str_out.str("");
+
+ //explore::print(boost::make_iterator_range(vvi.begin(), ++(++vvi.begin())), str_out);
+ //BOOST_CHECK_EQUAL(str_out.str(), "[[1, 2, 3], [1, 2, 3]]");
 }
 
 // This test shows that you can use a string to cause the same outputs


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