diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index bcaa772..1df869d 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -161,6 +161,7 @@ test-suite range : [ range-test ticket_5544_terminate_irange ] [ range-test ticket_5547 ] [ range-test ticket_5556_is_sorted_namespace ] + [ range-test ticket_5811_indirected_optional ] [ range-test ticket_6944 ] ; diff --git a/test/ticket_5811_indirected_optional.cpp b/test/ticket_5811_indirected_optional.cpp new file mode 100644 index 0000000..8b4033b --- /dev/null +++ b/test/ticket_5811_indirected_optional.cpp @@ -0,0 +1,47 @@ +// Boost.Range library +// +// Copyright Neil Groves 2014. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#include +#include + +#include +#include + +#include + +namespace boost +{ + namespace + { + void test_ticket_5811_indirected_optional() + { + std::vector > v; + std::vector r; + for (int i = 0; i < 10; ++i) + { + v.push_back(i); + r.push_back(i); + } + BOOST_CHECK_EQUAL_COLLECTIONS(r.begin(), r.end(), + v.begin(), v.end()); + } + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE("RangeTestSuite.ticket_5811_indirected_optional"); + + test->add(BOOST_TEST_CASE(&boost::test_ticket_5811_indirected_optional)); + + return test; +}