summaryrefslogtreecommitdiff
path: root/boost/test/data/test_case.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/test/data/test_case.hpp')
-rw-r--r--boost/test/data/test_case.hpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/boost/test/data/test_case.hpp b/boost/test/data/test_case.hpp
index 31a61d92ec..112be06c54 100644
--- a/boost/test/data/test_case.hpp
+++ b/boost/test/data/test_case.hpp
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2011-2014.
+// (C) Copyright Gennadiy Rozental 2001.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -15,6 +15,7 @@
// Boost.Test
#include <boost/test/data/config.hpp>
#include <boost/test/data/dataset.hpp>
+#include <boost/test/data/for_each_sample.hpp>
// Boost
#include <boost/preprocessor/repetition/enum_params.hpp>
@@ -41,11 +42,24 @@ namespace boost {
namespace unit_test {
namespace data {
+namespace ds_detail {
+
// ************************************************************************** //
-// ************** test_case_template ************** //
+// ************** seed ************** //
// ************************************************************************** //
-namespace ds_detail {
+struct seed {
+ template<typename DataSet>
+ typename data::result_of::make<DataSet>::type
+ operator->*( DataSet&& ds ) const
+ {
+ return data::make( std::forward<DataSet>( ds ) );
+ }
+};
+
+// ************************************************************************** //
+// ************** test_case_gen ************** //
+// ************************************************************************** //
template<typename TestCase,typename DataSet>
class test_case_gen : public test_unit_generator {
@@ -152,7 +166,7 @@ BOOST_AUTO_TU_REGISTRAR( test_name )( \
boost::unit_test::data::ds_detail::make_test_case_gen<test_name>( \
BOOST_STRINGIZE( test_name ), \
__FILE__, __LINE__, \
- boost::unit_test::data::make(dataset) ), \
+ boost::unit_test::data::ds_detail::seed{} ->* dataset ), \
boost::unit_test::decorator::collector::instance() ); \
\
template<BOOST_PP_ENUM_PARAMS(arity, typename Arg)> \