Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / algorithm / test / iota_test1.cpp
index 24fd0e3..747691f 100644 (file)
@@ -9,7 +9,9 @@
 
 #include <boost/config.hpp>
 #include <boost/algorithm/cxx11/iota.hpp>
-#include <boost/test/included/test_exec_monitor.hpp>
+
+#define BOOST_TEST_MAIN
+#include <boost/test/unit_test.hpp>
 
 #include <iostream>
 #include <string>
@@ -40,11 +42,11 @@ void test_ints () {
     std::vector<int> v;
     std::list<int> l;
 
-    v.clear (); v.reserve ( 10 );
+    v.clear (); v.resize ( 10 );
     boost::algorithm::iota ( v.begin (), v.end (), 23 );
     BOOST_CHECK ( test_iota_results ( v.begin (), v.end (), 23 ));
     
-    v.clear (); v.reserve ( 19 );
+    v.clear (); v.resize ( 19 );
     boost::algorithm::iota ( v, 18 );
     BOOST_CHECK ( test_iota_results ( v, 18 ));
     
@@ -52,6 +54,10 @@ void test_ints () {
     boost::algorithm::iota_n ( std::back_inserter(v), 99, 20 );
     BOOST_CHECK ( test_iota_results ( v, 99 ));
     
+    v.clear ();
+    boost::algorithm::iota_n ( std::back_inserter(v), 99, 0 );
+    BOOST_CHECK ( v.size() == 0 );
+
 /*
     l.clear (); l.reserve ( 5 );
     boost::algorithm::iota ( l.begin (), l.end (), 123 );
@@ -72,8 +78,7 @@ void test_ints () {
     }
 
 
-int test_main( int , char* [] )
+BOOST_AUTO_TEST_CASE( test_main )
 {
   test_ints ();
-  return 0;
 }