Skip to content

Commit

Permalink
iox-#1613 Use IOX_EXPECT_NO_FATAL_FAILURE in functional interface test
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Feb 9, 2023
1 parent 38bbee1 commit efc7d2e
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@ using namespace iox::testing;
template <typename FactoryType, typename SutType, typename ExpectCall>
void ExpectDoesNotCallTerminateWhenObjectIsValid(const ExpectCall& callExpect)
{
bool wasErrorHandlerCalled = false;
SutType sut = FactoryType::createValidObject();
{
auto handle = iox::ErrorHandlerMock::setTemporaryErrorHandler<iox::HoofsError>(
[&](auto, auto) { wasErrorHandlerCalled = true; });
callExpect(sut);
}

EXPECT_FALSE(wasErrorHandlerCalled);
IOX_EXPECT_NO_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); });
}

TYPED_TEST(FunctionalInterface_test, ExpectDoesNotCallTerminateWhenObjectIsValid_LValueCase)
Expand Down Expand Up @@ -83,9 +77,8 @@ template <typename FactoryType, typename SutType, typename ExpectCall>
void ExpectDoesCallTerminateWhenObjectIsInvalid(const ExpectCall& callExpect)
{
SutType sut = FactoryType::createInvalidObject();
{
IOX_EXPECT_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); }, iox::HoofsError::EXPECTS_ENSURES_FAILED);
}

IOX_EXPECT_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); }, iox::HoofsError::EXPECTS_ENSURES_FAILED);
}

TYPED_TEST(FunctionalInterface_test, ExpectDoesCallTerminateWhenObjectIsInvalid_LValueCase)
Expand Down

0 comments on commit efc7d2e

Please sign in to comment.