Boost logo

Boost Users :

Subject: [Boost-users] nested template tests using boost.test BOOST_AUTO_TEST_CASE_TEMPLATE
From: johanngoetz (jgoetz_at_[hidden])
Date: 2008-10-17 12:35:13


It seems that one cannot do nested AUTO_TEST_CASE_TEMPLATE's with boost.test.
Is there another way around this (besides unrolling manually)? I wish to do
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 <boost/test/unit_test.hpp>
#include <boost/test/test_case_template.hpp>
#include <boost/mpl/list.hpp>
typedef boost::mpl::list<short, int, long, long long> test_int_types;
typedef boost::mpl::list<float, double, long double> test_float_types;

BOOST_AUTO_TEST_SUITE( std_map_suite )
BOOST_AUTO_TEST_CASE_TEMPLATE( int_template_case, Ti, test_int_types ) {
    BOOST_AUTO_TEST_CASE_TEMPLATE( float_template_case, Tf, test_float_types
) {
        std::map<Ti, Tf> m;
        m.insert(std::make_pair((Ti)0,(Tf)0));
        BOOST_CHECK_EQUAL(m.size(), size_t(1));
    }
}
BOOST_AUTO_TEST_SUITE_END()

-- 
View this message in context: http://www.nabble.com/nested-template-tests-using-boost.test-BOOST_AUTO_TEST_CASE_TEMPLATE-tp20036811p20036811.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net