123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- /*=============================================================================
- Copyright (c) 2016 Lee Clagett
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanyintg file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
- ==============================================================================*/
- #include <boost/config.hpp>
- #include <boost/detail/lightweight_test.hpp>
- #include <boost/fusion/adapted/boost_tuple.hpp>
- #include <boost/fusion/adapted/std_pair.hpp>
- #if !defined(BOOST_NO_CXX11_HDR_TUPLE) \
- && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- # include <boost/fusion/adapted/std_tuple.hpp>
- #endif
- #include <boost/fusion/container/deque.hpp>
- #include <boost/fusion/container/list.hpp>
- #include <boost/fusion/tuple.hpp>
- #include <boost/fusion/container/vector.hpp>
- #include "fixture.hpp"
- template <template <typename> class Scenario>
- void test()
- {
- using namespace test_detail;
- // Note the trunction conversion tests from each containter
- // ... bug or feature?
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(FUSION_SEQUENCE<int>(300), 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::push_back(FUSION_SEQUENCE<int>(200), 400)
- , FUSION_SEQUENCE<convertible>(200)
- )
- ));
- BOOST_TEST((run<Scenario<FUSION_SEQUENCE<> > >(boost::fusion::vector<>())));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- boost::fusion::vector<int>(100), boost::fusion::vector<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::vector<int>(110)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::vector<int, int>(200, 100)
- , boost::fusion::vector<convertible>(200)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::vector<int, int>(200, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::vector<int, int, int>(500, 400, 100)
- , boost::fusion::vector<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::vector<int>(500), 400
- )
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::vector<int, int>(500, 400), 100
- )
- , boost::fusion::vector<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((run<Scenario< FUSION_SEQUENCE<> > >(boost::fusion::deque<>())));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- boost::fusion::deque<int>(100), boost::fusion::deque<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::deque<int>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::deque<int, int>(500, 100)
- , boost::fusion::deque<convertible>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::deque<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::deque<int, int, int>(500, 400, 100)
- , boost::fusion::deque<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::deque<int>(500), 400
- )
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::deque<int, int>(500, 400), 100
- )
- , boost::fusion::deque<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(boost::fusion::list<>())));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- boost::fusion::list<int>(100), boost::fusion::list<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::list<int>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::list<int, int>(500, 100)
- , boost::fusion::list<convertible>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::list<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::list<int, int, int>(500, 400, 100)
- , boost::fusion::list<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::list<int>(500), 400
- )
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::list<int, int>(500, 400), 100
- )
- , boost::fusion::list<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((run<Scenario< FUSION_SEQUENCE<> > >(boost::fusion::tuple<>())));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- boost::fusion::tuple<int>(100), boost::fusion::tuple<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::tuple<int>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::fusion::tuple<int, int>(500, 100)
- , boost::fusion::tuple<convertible>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::tuple<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::tuple<int, int, int>(500, 400, 100)
- , boost::fusion::tuple<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::tuple<int>(500), 400
- )
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::fusion::tuple<int, int>(500, 400), 100
- )
- , boost::fusion::tuple<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(boost::tuple<>())));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- boost::tuple<int>(100), boost::tuple<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::tuple<int>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- boost::tuple<int, int>(500, 100)
- , boost::tuple<convertible>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::tuple<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::tuple<int, int, int>(500, 400, 100)
- , boost::tuple<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(boost::tuple<int>(500), 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- boost::tuple<int, int>(500, 400), 100
- )
- , boost::tuple<convertible, int>(500, 400)
- )
- ));
- #if !defined(BOOST_NO_CXX11_HDR_TUPLE) \
- && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(std::tuple<>())));
- BOOST_TEST((
- run<Scenario<FUSION_SEQUENCE<> > >(std::tuple<int>(100), std::tuple<>())
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- std::tuple<int>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- std::tuple<int, int>(500, 100)
- , std::tuple<convertible>(500)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- std::tuple<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- std::tuple<int, int, int>(500, 400, 100)
- , std::tuple<convertible, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(std::tuple<int>(500), 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- boost::fusion::push_back(
- std::tuple<int, int>(500, 400), 100
- )
- , std::tuple<convertible, int>(500, 400)
- )
- ));
- #endif
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
- std::pair<int, int>(500, 400)
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<> > >(
- std::pair<int, int>(500, 400)
- , boost::fusion::vector<>()
- )
- ));
- BOOST_TEST((
- run< Scenario< FUSION_SEQUENCE<convertible> > >(
- std::pair<int, int>(500, 400)
- , boost::fusion::vector<convertible>(500)
- )
- ));
- }
|