Skip to content

Commit

Permalink
Merge pull request #116 from FelixPetriconi/develop
Browse files Browse the repository at this point in the history
Add test to recent fix
  • Loading branch information
FelixPetriconi authored Dec 12, 2017
2 parents 865c5e6 + 3613210 commit c0f9da6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: required
dist: trusty
group: deprecated-2017Q4
language: cpp

cache:
Expand Down
23 changes: 22 additions & 1 deletion test/future_then_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,27 @@ BOOST_FIXTURE_TEST_SUITE(future_void_then_error, test_fixture<void>)
BOOST_REQUIRE_EQUAL(42, p);
BOOST_REQUIRE_LE(2, custom_scheduler<0>::usage_counter());
}

BOOST_AUTO_TEST_CASE(reduction_future_void_to_void_error) {
BOOST_TEST_MESSAGE("running future reduction void to void where the inner future fails");
std::atomic_bool first{ false };
std::atomic_bool second{ false };

sut = async(default_executor, [&_flag = first] {
_flag = true;
}).then([&_flag = second] {
return async(default_executor, [&_flag] {
_flag = true;
throw test_exception("failure");
});
});

wait_until_future_fails<test_exception>(sut);

BOOST_REQUIRE(first);
BOOST_REQUIRE(second);
}

BOOST_AUTO_TEST_SUITE_END()


Expand Down Expand Up @@ -777,7 +798,7 @@ BOOST_FIXTURE_TEST_SUITE(future_then_int_error, test_fixture<int>)
}



BOOST_AUTO_TEST_SUITE_END()


Expand Down

0 comments on commit c0f9da6

Please sign in to comment.