Split the chaining tests into multiple ones

This commit is contained in:
Denis Blank 2017-10-03 17:15:42 +02:00
parent 2008f006a0
commit b8ff4c4c18
2 changed files with 33 additions and 44 deletions

View File

@ -1,9 +1,3 @@
if (${MSVC_VERSION} LESS 1900)
message(FATAL_ERROR "You are using an unsupported version of Visual Studio "
"which doesn't support all required C++11 features. "
"(Visual Studio 2015 (version >= 1900) is required!)")
endif()
if(CMAKE_SIZEOF_VOID_P MATCHES 8) if(CMAKE_SIZEOF_VOID_P MATCHES 8)
set(PLATFORM 64) set(PLATFORM 64)
else() else()
@ -14,7 +8,7 @@ if (PLATFORM EQUAL 64)
add_definitions("-D_WIN64") add_definitions("-D_WIN64")
endif() endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP /bigobj") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP1 /bigobj")
if (TESTS_NO_EXCEPTIONS) if (TESTS_NO_EXCEPTIONS)
add_definitions(-D_HAS_EXCEPTIONS=0) add_definitions(-D_HAS_EXCEPTIONS=0)

View File

@ -30,15 +30,14 @@ TYPED_TEST(single_dimension_tests, are_chainable) {
EXPECT_ASYNC_RESULT(this->supply().then([] { EXPECT_ASYNC_RESULT(this->supply().then([] {
return; // void return; // void
})); }));
}
// Type chain TYPED_TEST(single_dimension_tests, are_type_chainable) {
{
auto chain = this->supply().then([] { return tag1{}; }); auto chain = this->supply().then([] { return tag1{}; });
ASSERT_ASYNC_TYPES(std::move(chain), tag1); ASSERT_ASYNC_TYPES(std::move(chain), tag1);
} }
// Pair chain TYPED_TEST(single_dimension_tests, are_pair_chainable) {
{
auto chain = this->supply().then([] { auto chain = this->supply().then([] {
// ... // ...
return std::make_pair(tag1{}, tag2{}); return std::make_pair(tag1{}, tag2{});
@ -46,8 +45,7 @@ TYPED_TEST(single_dimension_tests, are_chainable) {
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2); ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2);
} }
// Tuple chain TYPED_TEST(single_dimension_tests, are_tuple_chainable) {
{
auto chain = this->supply().then([] { auto chain = this->supply().then([] {
// ... // ...
return std::make_tuple(tag1{}, tag2{}, tag3{}); return std::make_tuple(tag1{}, tag2{}, tag3{});
@ -55,16 +53,13 @@ TYPED_TEST(single_dimension_tests, are_chainable) {
ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3); ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3);
} }
// Erasing chain TYPED_TEST(single_dimension_tests, are_erasing_chainable) {
{
auto chain = this->supply().then(this->supply(tag1{})); auto chain = this->supply().then(this->supply(tag1{}));
ASSERT_ASYNC_TYPES(std::move(chain), tag1); ASSERT_ASYNC_TYPES(std::move(chain), tag1);
} }
// Continuing chain TYPED_TEST(single_dimension_tests, are_continuing_chainable) {
{
auto chain = this->supply().then([&] { return this->supply(tag1{}); }); auto chain = this->supply().then([&] { return this->supply(tag1{}); });
ASSERT_ASYNC_TYPES(std::move(chain), tag1); ASSERT_ASYNC_TYPES(std::move(chain), tag1);
} }
}