Skip to content

Commit 1316b6d

Browse files
authored
Merge pull request #158 from bretthall/master
Warning fixes when using Boost.Test and VS2015
2 parents ffcdd99 + b96d222 commit 1316b6d

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

extras/boost_test/include/rapidcheck/boost_test.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ namespace rc {
88
namespace detail {
99

1010
template <typename Testable>
11-
void checkBoostTest(const std::string &description, Testable &&testable) {
11+
void checkBoostTest(Testable &&testable) {
1212
const auto &testCase = boost::unit_test::framework::current_test_case();
1313
TestMetadata metadata;
1414
metadata.id = testCase.full_name();
1515
metadata.description = testCase.p_name;
1616

1717
const auto result = checkTestable(std::forward<Testable>(testable), metadata);
1818

19+
// Without this boost.test will complain about the test case having no assertions when the
20+
// rapidcheck test passes
21+
BOOST_CHECK (true);
22+
1923
if (result.template is<SuccessResult>()) {
2024
const auto success = result.template get<SuccessResult>();
2125
if (!success.distribution.empty()) {
@@ -39,7 +43,7 @@ void checkBoostTest(const std::string &description, Testable &&testable) {
3943
void rapidCheck_propImpl_##Name ArgList; \
4044
\
4145
BOOST_AUTO_TEST_CASE(Name) { \
42-
::rc::detail::checkBoostTest(#Name, &rapidCheck_propImpl_##Name); \
46+
::rc::detail::checkBoostTest(&rapidCheck_propImpl_##Name); \
4347
} \
4448
\
4549
void rapidCheck_propImpl_##Name ArgList
@@ -55,8 +59,7 @@ void checkBoostTest(const std::string &description, Testable &&testable) {
5559
}; \
5660
\
5761
BOOST_AUTO_TEST_CASE(Name) { \
58-
::rc::detail::checkBoostTest( \
59-
#Name, \
62+
::rc::detail::checkBoostTest( \
6063
&rc::detail::ExecFixture< \
6164
RapidCheckPropImpl_##Fixture##_##Name>::exec); \
6265
} \

include/rapidcheck/Gen.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ Shrinkable<T> Gen<T>::operator()(const Random &random, int size) const
7171
auto exception = std::current_exception();
7272
return shrinkable::lambda([=]() -> T {
7373
std::rethrow_exception(exception);
74-
75-
// MSVC HACK: the following is required for MSVC to stop complaining
76-
// about missing return value. Will never be reached, of
77-
// course.
78-
#ifdef _MSC_VER
79-
throw nullptr;
80-
#endif // _MSC_VER
8174
});
8275
}
8376
}

0 commit comments

Comments
 (0)