Skip to content

Commit

Permalink
Merge pull request #1309 from ApexAI/iox-#1072-replace-fail-and-succe…
Browse files Browse the repository at this point in the history
…ed-with-gtest_fail-and-gtest_succeed

iox-#1072 replace FAIL and SUCCEED with GTEST_FAIL and GTEST_SUCCEED
  • Loading branch information
elBoberido authored Apr 4, 2022
2 parents 262e631 + 63236d7 commit c41c8cd
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 49 deletions.
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Separate module specific errors from `iceoryx_hoofs` [\#1099](https://github.com/eclipse-iceoryx/iceoryx/issues/1099)
- Move test specific code to `ErrorHandlerMock` and templatize `setTemporaryErrorHandler()`
- Create separate error enum for each module
- Use `GTEST_FAIL` and `GTEST_SUCCEED` instead of `FAIL` and `SUCCEED` [\#1072](https://github.com/eclipse-iceoryx/iceoryx/issues/1072)

**New API features:**

Expand Down
4 changes: 2 additions & 2 deletions iceoryx_binding_c/test/moduletests/test_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ TIMING_TEST_F(iox_listener_test, SubscriberCallbackIsCalledSampleIsReceived, Rep

m_memoryManager.getChunk(chunkSettings)
.and_then([&](auto& chunk) { m_chunkPusher[0U].push(chunk); })
.or_else([](auto& error) { FAIL() << "getChunk failed with: " << error; });
.or_else([](auto& error) { GTEST_FAIL() << "getChunk failed with: " << error; });

std::this_thread::sleep_for(TIMEOUT);
EXPECT_THAT(g_subscriberCallbackArgument, Eq(&m_subscriber[0U]));
Expand All @@ -410,7 +410,7 @@ TIMING_TEST_F(iox_listener_test, SubscriberCallbackWithContextDataIsCalledSample

m_memoryManager.getChunk(chunkSettings)
.and_then([&](auto& chunk) { m_chunkPusher[0U].push(chunk); })
.or_else([](auto& error) { FAIL() << "getChunk failed with: " << error; });
.or_else([](auto& error) { GTEST_FAIL() << "getChunk failed with: " << error; });

std::this_thread::sleep_for(TIMEOUT);
EXPECT_THAT(g_subscriberCallbackArgument, Eq(&m_subscriber[0U]));
Expand Down
12 changes: 8 additions & 4 deletions iceoryx_hoofs/test/moduletests/test_cxx_expected.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,9 @@ TEST_F(expected_test, WhenHavingSuccessAndMoveAssignmentCallsAndThen)
IOX_DISCARD_RESULT(movedValue);

bool success{false};
sut.and_then([&](auto&) { success = true; }).or_else([&](auto&) { FAIL() << "'or_else' should not be called"; });
sut.and_then([&](auto&) { success = true; }).or_else([&](auto&) {
GTEST_FAIL() << "'or_else' should not be called";
});
EXPECT_TRUE(success);
}

Expand All @@ -564,7 +566,9 @@ TEST_F(expected_test, WhenHavingAnErrorAndMoveAssignmentCallsOrElse)
IOX_DISCARD_RESULT(movedValue);

bool success{false};
sut.and_then([&](auto&) { FAIL() << "'and_then' should not be called"; }).or_else([&](auto&) { success = true; });
sut.and_then([&](auto&) { GTEST_FAIL() << "'and_then' should not be called"; }).or_else([&](auto&) {
success = true;
});
EXPECT_TRUE(success);
}

Expand All @@ -576,7 +580,7 @@ TEST_F(expected_test, ErrorTypeOnlyWhenHavingSuccessAndMoveAssignmentCallsAndThe
IOX_DISCARD_RESULT(movedValue);

bool success{false};
sut.and_then([&]() { success = true; }).or_else([&](auto&) { FAIL() << "'or_else' should not be called"; });
sut.and_then([&]() { success = true; }).or_else([&](auto&) { GTEST_FAIL() << "'or_else' should not be called"; });
EXPECT_TRUE(success);
}

Expand All @@ -588,7 +592,7 @@ TEST_F(expected_test, ErrorTypeOnlyWhenHavingAnErrorAndMoveAssignmentCallsOrElse
IOX_DISCARD_RESULT(movedValue);

bool success{false};
sut.and_then([&]() { FAIL() << "'and_then' should not be called"; }).or_else([&](auto&) { success = true; });
sut.and_then([&]() { GTEST_FAIL() << "'and_then' should not be called"; }).or_else([&](auto&) { success = true; });
EXPECT_TRUE(success);
}

Expand Down
8 changes: 4 additions & 4 deletions iceoryx_hoofs/test/moduletests/test_relocatable_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,11 @@ TYPED_TEST(Relocatable_ptr_typed_test, negativeNullPointerCheckWithIfWorks)

if (rp)
{
SUCCEED();
GTEST_SUCCEED();
}
else
{
FAIL();
GTEST_FAIL();
}
}

Expand All @@ -471,11 +471,11 @@ TYPED_TEST(Relocatable_ptr_typed_test, positiveNullPointerCheckWithIfWorks)

if (rp)
{
FAIL();
GTEST_FAIL();
}
else
{
SUCCEED();
GTEST_SUCCEED();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ChunkBuildingBlocks_IntegrationTest : public Test
})
.or_else([](AllocationError) {
// Errors shall never occur
FAIL();
GTEST_FAIL();
});

/// Add some jitter to make thread breathe
Expand Down Expand Up @@ -192,7 +192,7 @@ class ChunkBuildingBlocks_IntegrationTest : public Test
else
{
// Errors shall never occur
FAIL();
GTEST_FAIL();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class PortUser_IntegrationTest : public Test
else
{
// Error shall never occur
FAIL() << "Error in subscriber SUB CaPro message!";
GTEST_FAIL() << "Error in subscriber SUB CaPro message!";
}

// Wait for subscription ACK from publisher
Expand Down Expand Up @@ -219,7 +219,7 @@ class PortUser_IntegrationTest : public Test
else
{
// Errors shall never occur
FAIL() << "Error in tryGetChunk(): " << static_cast<uint32_t>(result);
GTEST_FAIL() << "Error in tryGetChunk(): " << static_cast<uint32_t>(result);
}
});
}
Expand Down Expand Up @@ -248,7 +248,7 @@ class PortUser_IntegrationTest : public Test
else
{
// Error shall never occur
FAIL() << "Error in publisher OFFER CaPro message!";
GTEST_FAIL() << "Error in publisher OFFER CaPro message!";
}

// Wait for subscriber to subscribe
Expand All @@ -266,7 +266,7 @@ class PortUser_IntegrationTest : public Test
else
{
// Error shall never occur
FAIL() << "Error in publisher ACK CaPro message!";
GTEST_FAIL() << "Error in publisher ACK CaPro message!";
}
}
else
Expand Down Expand Up @@ -305,7 +305,7 @@ class PortUser_IntegrationTest : public Test
})
.or_else([](auto error) {
// Errors shall never occur
FAIL() << "Error in tryAllocateChunk(): " << static_cast<uint32_t>(error);
GTEST_FAIL() << "Error in tryAllocateChunk(): " << static_cast<uint32_t>(error);
});

/// Add some jitter to make thread breathe
Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/test/moduletests/test_capro_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ TEST_F(ServiceDescription_test, ServiceDescriptionSerializationCreatesServiceDes
EXPECT_THAT(service.getSourceInterface(), Eq(Interfaces::INTERNAL));
})
.or_else([](const auto& error) {
FAIL() << "Deserialization should not fail but failed with: " << static_cast<uint32_t>(error);
GTEST_FAIL() << "Deserialization should not fail but failed with: " << static_cast<uint32_t>(error);
});
}

Expand Down
27 changes: 16 additions & 11 deletions iceoryx_posh/test/moduletests/test_mepoo_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MemoryManager_test : public Test
EXPECT_TRUE(chunk);
chunkStore.push_back(chunk);
})
.or_else([](const auto& error) { FAIL() << "getChunk failed with: " << error; });
.or_else([](const auto& error) { GTEST_FAIL() << "getChunk failed with: " << error; });
}
return chunkStore;
}
Expand Down Expand Up @@ -171,7 +171,8 @@ TEST_F(MemoryManager_test, GetChunkMethodWithNoMemPoolInMemConfigReturnsError)

constexpr auto EXPECTED_ERROR{iox::mepoo::MemoryManager::Error::NO_MEMPOOLS_AVAILABLE};
sut->getChunk(chunkSettings)
.and_then([&](auto&) { FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.and_then(
[&](auto&) { GTEST_FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });

ASSERT_TRUE(detectedError.has_value());
Expand Down Expand Up @@ -202,7 +203,8 @@ TEST_F(MemoryManager_test, GetChunkMethodWithChunkSizeGreaterThanAvailableChunkS

constexpr auto EXPECTED_ERROR{iox::mepoo::MemoryManager::Error::NO_MEMPOOL_FOR_REQUESTED_CHUNK_SIZE};
sut->getChunk(chunkSettings)
.and_then([&](auto&) { FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.and_then(
[&](auto&) { GTEST_FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });

ASSERT_TRUE(detectedError.has_value());
Expand Down Expand Up @@ -230,7 +232,8 @@ TEST_F(MemoryManager_test, GetChunkMethodWhenNoFreeChunksInMemPoolConfigReturnsE

constexpr auto EXPECTED_ERROR{iox::mepoo::MemoryManager::Error::MEMPOOL_OUT_OF_CHUNKS};
sut->getChunk(chunkSettings)
.and_then([&](auto&) { FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.and_then(
[&](auto&) { GTEST_FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });

ASSERT_TRUE(detectedError.has_value());
Expand All @@ -250,7 +253,7 @@ TEST_F(MemoryManager_test, VerifyGetChunkMethodWhenTheRequestedChunkIsAvailableI
auto& chunkSettings = chunkSettingsResult.value();

sut->getChunk(chunkSettings).and_then([&](auto& chunk) { EXPECT_TRUE(chunk); }).or_else([](const auto& error) {
FAIL() << "getChunk failed with: " << error;
GTEST_FAIL() << "getChunk failed with: " << error;
});
}

Expand Down Expand Up @@ -284,7 +287,8 @@ TEST_F(MemoryManager_test, getChunkSingleMemPoolToMuchChunks)

constexpr auto EXPECTED_ERROR{iox::mepoo::MemoryManager::Error::MEMPOOL_OUT_OF_CHUNKS};
sut->getChunk(chunkSettings_128)
.and_then([&](auto&) { FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.and_then(
[&](auto&) { GTEST_FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });
}

Expand Down Expand Up @@ -325,7 +329,7 @@ TEST_F(MemoryManager_test, getChunkMultiMemPoolSingleChunk)
for (const auto& chunkSettings : {chunkSettings_32, chunkSettings_64, chunkSettings_128, chunkSettings_256})
{
sut->getChunk(chunkSettings).and_then([&](auto& chunk) { EXPECT_TRUE(chunk); }).or_else([](const auto& error) {
FAIL() << "getChunk failed with: " << error;
GTEST_FAIL() << "getChunk failed with: " << error;
});
}
}
Expand Down Expand Up @@ -374,8 +378,8 @@ TEST_F(MemoryManager_test, getChunkMultiMemPoolTooMuchChunks)
{
sut->getChunk(chunkSettings)
.and_then([&](auto&) {
FAIL() << "getChunk for payload size " << chunkSettings.userPayloadSize() << " should fail with '"
<< EXPECTED_ERROR << "' but did not fail";
GTEST_FAIL() << "getChunk for payload size " << chunkSettings.userPayloadSize() << " should fail with '"
<< EXPECTED_ERROR << "' but did not fail";
})
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });
}
Expand All @@ -396,7 +400,8 @@ TEST_F(MemoryManager_test, emptyMemPoolDoesNotResultInAcquiringChunksFromOtherMe

constexpr auto EXPECTED_ERROR{iox::mepoo::MemoryManager::Error::MEMPOOL_OUT_OF_CHUNKS};
sut->getChunk(chunkSettings_64)
.and_then([&](auto&) { FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.and_then(
[&](auto&) { GTEST_FAIL() << "getChunk should fail with '" << EXPECTED_ERROR << "' but did not fail"; })
.or_else([&](const auto& error) { EXPECT_EQ(error, EXPECTED_ERROR); });

EXPECT_THAT(sut->getMemPoolInfo(0).m_usedChunks, Eq(0U));
Expand Down Expand Up @@ -459,7 +464,7 @@ TEST_F(MemoryManager_test, getChunkWithUserPayloadSizeZeroShouldNotFail)
sut->configureMemoryManager(mempoolconf, *allocator, *allocator);

sut->getChunk(chunkSettings).and_then([&](auto& chunk) { EXPECT_TRUE(chunk); }).or_else([](const auto& error) {
FAIL() << "getChunk failed with: " << error;
GTEST_FAIL() << "getChunk failed with: " << error;
});
}

Expand Down
2 changes: 1 addition & 1 deletion iceoryx_posh/test/moduletests/test_mepoo_segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ TEST_F(MePooSegment_test, ADD_TEST_WITH_ADDITIONAL_USER(GetMemoryManager))
sut.getMemoryManager()
.getChunk(chunkSettings)
.and_then([&](auto& chunk) { EXPECT_THAT(chunk.getChunkHeader()->userPayloadSize(), Eq(USER_PAYLOAD_SIZE)); })
.or_else([](auto& error) { FAIL() << "getChunk failed with: " << error; });
.or_else([](auto& error) { GTEST_FAIL() << "getChunk failed with: " << error; });
}

} // namespace
16 changes: 8 additions & 8 deletions iceoryx_posh/test/moduletests/test_popo_chunk_distributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithAddedQueueReturnsIndex)

sut.getQueueIndex(queueData->m_uniqueId, EXPECTED_QUEUE_INDEX)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });
}

TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithMultipleAddedQueuesReturnsIndex)
Expand All @@ -294,15 +294,15 @@ TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithMultipleAddedQueuesReturnsInd

sut.getQueueIndex(queueData1->m_uniqueId, EXPECTED_QUEUE_INDEX_1)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_1)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });

sut.getQueueIndex(queueData2->m_uniqueId, EXPECTED_QUEUE_INDEX_2)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_2)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });

sut.getQueueIndex(queueData3->m_uniqueId, EXPECTED_QUEUE_INDEX_3)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_3)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });
}

TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithMultipleAddedQueuesAndUnknownLastIndexReturnsIndex)
Expand All @@ -325,15 +325,15 @@ TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithMultipleAddedQueuesAndUnknown

sut.getQueueIndex(queueData1->m_uniqueId, UNKNOWN_QUEUE_INDEX)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_1)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });

sut.getQueueIndex(queueData2->m_uniqueId, UNKNOWN_QUEUE_INDEX)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_2)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });

sut.getQueueIndex(queueData3->m_uniqueId, UNKNOWN_QUEUE_INDEX)
.and_then([&](const auto& index) { EXPECT_THAT(index, Eq(EXPECTED_QUEUE_INDEX_3)); })
.or_else([] { FAIL() << "Expected to get an index!"; });
.or_else([] { GTEST_FAIL() << "Expected to get an index!"; });
}

TYPED_TEST(ChunkDistributor_test, GetQueueIndexWithPreviouslyAddedQueueRemovedReturnsNoIndex)
Expand Down Expand Up @@ -549,7 +549,7 @@ TYPED_TEST(ChunkDistributor_test, DeliverToQueueWithoutAddedQueueReturnsError)

auto chunk = this->allocateChunk(111);
sut.deliverToQueue(queueData->m_uniqueId, UNKNOWN_QUEUE_INDEX, chunk)
.and_then([] { FAIL() << "Expected fail with'ChunkDistributorError::QUEUE_NOT_IN_CONTAINER'!"; })
.and_then([] { GTEST_FAIL() << "Expected fail with'ChunkDistributorError::QUEUE_NOT_IN_CONTAINER'!"; })
.or_else([](const auto& error) { EXPECT_THAT(error, Eq(ChunkDistributorError::QUEUE_NOT_IN_CONTAINER)); });
}

Expand Down
10 changes: 5 additions & 5 deletions iceoryx_posh/test/moduletests/test_popo_publisher_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ TEST(PublisherOptions_test, SerializationRoundTripIsSuccessful)
EXPECT_THAT(roundTripOptions.subscriberTooSlowPolicy, Ne(defaultOptions.subscriberTooSlowPolicy));
EXPECT_THAT(roundTripOptions.subscriberTooSlowPolicy, Eq(testOptions.subscriberTooSlowPolicy));
})
.or_else([&](auto&) { FAIL() << "Serialization/Deserialization of PublisherOptions failed!"; });
.or_else([&](auto&) { GTEST_FAIL() << "Serialization/Deserialization of PublisherOptions failed!"; });
}

TEST(PublisherOptions_test, DeserializingBogusDataFails)
{
::testing::Test::RecordProperty("TEST_ID", "01c4b42b-5636-4bd2-b2de-c5320b170d71");
const auto bogusSerialization = iox::cxx::Serialization::create("hypnotoad", "brain slug", "rock star");
iox::popo::PublisherOptions::deserialize(bogusSerialization)
.and_then([&](auto&) { FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { SUCCEED(); });
.and_then([&](auto&) { GTEST_FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { GTEST_SUCCEED(); });
}

TEST(PublisherOptions_test, DeserializingInvalidSubscriberTooSlowPolicyFails)
Expand All @@ -70,8 +70,8 @@ TEST(PublisherOptions_test, DeserializingInvalidSubscriberTooSlowPolicyFails)
const auto serialized =
iox::cxx::Serialization::create(HISTORY_CAPACITY, NODE_NAME, OFFER_ON_CREATE, SUBSCRIBER_TOO_SLOW_POLICY);
iox::popo::PublisherOptions::deserialize(serialized)
.and_then([&](auto&) { FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { SUCCEED(); });
.and_then([&](auto&) { GTEST_FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { GTEST_SUCCEED(); });
}

} // namespace
2 changes: 1 addition & 1 deletion iceoryx_posh/test/moduletests/test_popo_server_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TEST(ServerOptions_test, SerializationRoundTripIsSuccessful)
EXPECT_THAT(roundTripOptions.clientTooSlowPolicy, Ne(defaultOptions.clientTooSlowPolicy));
EXPECT_THAT(roundTripOptions.clientTooSlowPolicy, Eq(testOptions.clientTooSlowPolicy));
})
.or_else([&](auto&) { FAIL() << "Serialization/Deserialization of ServerOptions failed!"; });
.or_else([&](auto&) { GTEST_FAIL() << "Serialization/Deserialization of ServerOptions failed!"; });
}

TEST(ServerOptions_test, DeserializingBogusDataFails)
Expand Down
10 changes: 5 additions & 5 deletions iceoryx_posh/test/moduletests/test_popo_subscriber_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ TEST(SubscriberOptions_test, SerializationRoundTripIsSuccessful)
EXPECT_THAT(roundTripOptions.requiresPublisherHistorySupport,
Eq(testOptions.requiresPublisherHistorySupport));
})
.or_else([&](auto&) { FAIL() << "Serialization/Deserialization of SubscriberOptions failed!"; });
.or_else([&](auto&) { GTEST_FAIL() << "Serialization/Deserialization of SubscriberOptions failed!"; });
}

TEST(SubscriberOptions_test, DeserializingBogusDataFails)
{
::testing::Test::RecordProperty("TEST_ID", "6b4b77cc-09ce-4f71-b2b5-371be27f863a");
const auto bogusSerialization = iox::cxx::Serialization::create("hypnotoad", "brain slug", "rock star");
iox::popo::SubscriberOptions::deserialize(bogusSerialization)
.and_then([&](auto&) { FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { SUCCEED(); });
.and_then([&](auto&) { GTEST_FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { GTEST_SUCCEED(); });
}

TEST(SubscriberOptions_test, DeserializingInvalidQueueFullPolicyFails)
Expand All @@ -78,8 +78,8 @@ TEST(SubscriberOptions_test, DeserializingInvalidQueueFullPolicyFails)
const auto serialized = iox::cxx::Serialization::create(
QUEUE_CAPACITY, HISTORY_REQUEST, NODE_NAME, SUBSCRIBE_ON_CREATE, QUEUE_FULL_POLICY);
iox::popo::SubscriberOptions::deserialize(serialized)
.and_then([&](auto&) { FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { SUCCEED(); });
.and_then([&](auto&) { GTEST_FAIL() << "Deserialization is expected to fail!"; })
.or_else([&](auto&) { GTEST_SUCCEED(); });
}

} // namespace

0 comments on commit c41c8cd

Please sign in to comment.