[test] data driven test fails to compile when number of samples greater than 9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[test] data driven test fails to compile when number of samples greater than 9

Boost - Users mailing list
Hello,

I am having trouble compiling a simple data driven test with 10 samples. I am using clang++ (Apple LLVM version 9.0.0 (clang-900.0.39.2))with C++14 flags enabled. According to this help page http://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/utf_reference/test_org_reference/test_org_boost_test_dataset.html
my compiler should have no problem dealing with number of samples greater than  BOOST_TEST_DATASET_MAX_ARITY which is 10 by default. Even defining BOOST_TEST_DATASET_MAX_ARITY to 20 prior to including any headers still fails to compile with the following error:

/usr/local/include/boost/test/data/test_case.hpp:182: error: no matching function for call to 'bind'
                           boost::bind( &TestCase::template test_method<Arg...>,
                           ^~~~~~~~~~~

Any ideas how to fix it? Here is the code:

#define BOOST_TEST_MODULE dataset_example68
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
#include <sstream>

namespace bdata = boost::unit_test::data;

BOOST_DATA_TEST_CASE(
test1,
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ) ^
bdata::make( { 1, 2, 3, 5 } ),
sample1, sample2, sample3, sample4, sample5, sample6, sample7, sample8, sample9, sample10)
{}


Thank you!

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [test] data driven test fails to compile when number of samples greater than 9

Boost - Users mailing list
Le 02.02.18 à 18:53, Georgios Sermaidis via Boost-users a écrit :

> Hello,
>
> I am having trouble compiling a simple data driven test with 10 samples.
> I am using clang++ (Apple LLVM version 9.0.0 (clang-900.0.39.2))with
> C++14 flags enabled. According to this help
> page http://www.boost.org/doc/libs/1_66_0/libs/test/doc/html/boost_test/utf_reference/test_org_reference/test_org_boost_test_dataset.html
> my compiler should have no problem dealing with number of samples
> greater than  |BOOST_TEST_DATASET_MAX_ARITY| which is 10 by default.
> Even defining BOOST_TEST_DATASET_MAX_ARITY to 20 prior to including any
> headers still fails to compile with the following error:
>
> /usr/local/include/boost/test/data/test_case.hpp:182: error: no matching
> function for call to 'bind'
>                            boost::bind( &TestCase::template
> test_method<Arg...>,
>                            ^~~~~~~~~~~
>
> Any ideas how to fix it? Here is the code:
>

Apparently this is a boost.bind limitation. I however remember having
problems with std::bind, that is truly variadic. Please raise a ticket
on trac.

Raffi

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users