Skip to content

Commit efc7d2e

Browse files
committed
iox-eclipse-iceoryx#1613 Use IOX_EXPECT_NO_FATAL_FAILURE in functional interface test
1 parent 38bbee1 commit efc7d2e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

iceoryx_hoofs/test/moduletests/test_design_functional_interface_expect.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,9 @@ using namespace iox::testing;
3939
template <typename FactoryType, typename SutType, typename ExpectCall>
4040
void ExpectDoesNotCallTerminateWhenObjectIsValid(const ExpectCall& callExpect)
4141
{
42-
bool wasErrorHandlerCalled = false;
4342
SutType sut = FactoryType::createValidObject();
44-
{
45-
auto handle = iox::ErrorHandlerMock::setTemporaryErrorHandler<iox::HoofsError>(
46-
[&](auto, auto) { wasErrorHandlerCalled = true; });
47-
callExpect(sut);
48-
}
4943

50-
EXPECT_FALSE(wasErrorHandlerCalled);
44+
IOX_EXPECT_NO_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); });
5145
}
5246

5347
TYPED_TEST(FunctionalInterface_test, ExpectDoesNotCallTerminateWhenObjectIsValid_LValueCase)
@@ -83,9 +77,8 @@ template <typename FactoryType, typename SutType, typename ExpectCall>
8377
void ExpectDoesCallTerminateWhenObjectIsInvalid(const ExpectCall& callExpect)
8478
{
8579
SutType sut = FactoryType::createInvalidObject();
86-
{
87-
IOX_EXPECT_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); }, iox::HoofsError::EXPECTS_ENSURES_FAILED);
88-
}
80+
81+
IOX_EXPECT_FATAL_FAILURE<iox::HoofsError>([&] { callExpect(sut); }, iox::HoofsError::EXPECTS_ENSURES_FAILED);
8982
}
9083

9184
TYPED_TEST(FunctionalInterface_test, ExpectDoesCallTerminateWhenObjectIsInvalid_LValueCase)

0 commit comments

Comments
 (0)