From 31a196f12caed4ece6f1295ae61739ccc577e8fe Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Tue, 9 Feb 2016 16:55:04 +0100 Subject: [PATCH] add unit-test for passing pointers between execution_context --- test/test_execution_context_v2.impl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_execution_context_v2.impl b/test/test_execution_context_v2.impl index 8fdb34e..9f30530 100644 --- a/test/test_execution_context_v2.impl +++ b/test/test_execution_context_v2.impl @@ -41,6 +41,9 @@ struct Y { value1 = 3; } + Y( Y const&) = delete; + Y & operator=( Y const&) = delete; + ~Y() { value1 = 7; } @@ -183,6 +186,11 @@ ctx::execution_context< variant_t > fn14( ctx::execution_context< variant_t > ct return ctx; } +ctx::execution_context< Y * > fn15( ctx::execution_context< Y * > ctx, Y * py) { + ctx( py); + return ctx; +} + void test_move() { value1 = 0; @@ -343,6 +351,13 @@ void test_one_arg() { std::tie( ctx, k) = ctx( i); BOOST_CHECK( & i != & k); } + { + Y y; + Y * py = nullptr; + ctx::execution_context< Y * > ctx( fn15); + std::tie( ctx, py) = ctx( & y); + BOOST_CHECK( py == & y); + } { moveable m1( 7), m2; BOOST_CHECK( 7 == m1.value);