Subject: [Boost-bugs] [Boost C++ Libraries] #13170: BOOST_AUTO_TEST_CASE_TEMPLATE don't want typedef for list
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-08-21 06:33:39
#13170: BOOST_AUTO_TEST_CASE_TEMPLATE don't want typedef for list
--------------------------------------------+------------------------------
Reporter: Oleksandr Guteniev <gutenev@â¦> | Owner: Gennadiy
| Rozental
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.61.0 | Severity: Cosmetic
Keywords: |
--------------------------------------------+------------------------------
It is possible to test several types using BOOST_AUTO_TEST_CASE_TEMPLATE
{{{
typedef boost::mpl::list<int,long,unsigned char> test_types;
BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T, test_types )
{
BOOST_TEST( sizeof(T) == (unsigned)4 );
}
}}}
But if I don't want to introduce a typedef not used elsewhere, as every
individual test would have separate type list:
{{{
BOOST_AUTO_TEST_CASE_TEMPLATE(
my_test,
T,
boost::mpl::list<
int,
long,
unsigned char
> )
{
BOOST_TEST( sizeof(T) == (unsigned)4 );
}
}}}
The code above doesn't compile though due to comma in macro. It can be
worked around, but workarounds seems to be worse than having extra
typedef.
I propose using variadic macro for types parameter and make the example
above compiling.
-- Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13170> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-08-21 06:39:52 UTC