johanngoetz
It seems that one cannot do nested AUTO_TEST_CASE_TEMPLATE's with boost.test.
No. Neither of the Boost.Test test cases really support this kind of usage
Is there another way around this (besides unrolling manually)? I wish to do
Not really manually, but you will have to linearize it
something like the following: i.e. testing every combination of two (or more?) lists of types. Example below. Thank you, Johann.
define BOOST_TEST_MODULE std_map #define BOOST_TEST_DYN_LINK #include <map> #include
#include #include typedef boost::mpl::list test_int_types; typedef boost::mpl::list test_float_types;
I believe MPL have something to help here. What you need is to have linear_view
like this:
typedef linear_view
BOOST_AUTO_TEST_SUITE( std_map_suite ) BOOST_AUTO_TEST_CASE_TEMPLATE( int_template_case, Ti, test_int_types ) {
Now you can write: BOOST_AUTO_TEST_CASE_TEMPLATE( test_case, TT, test_types ) {
) { std::map
m;
and use like this:
std::map
m.insert(std::make_pair((Ti)0,(Tf)0)); BOOST_CHECK_EQUAL(m.size(), size_t(1)); } } BOOST_AUTO_TEST_SUITE_END()
Gennadiy