diff --git a/iceoryx_hoofs/test/moduletests/error_reporting/test_custom_error_reporting.cpp b/iceoryx_hoofs/test/moduletests/error_reporting/test_custom_error_reporting.cpp index d7d5a48871..8305d243de 100644 --- a/iceoryx_hoofs/test/moduletests/error_reporting/test_custom_error_reporting.cpp +++ b/iceoryx_hoofs/test/moduletests/error_reporting/test_custom_error_reporting.cpp @@ -33,8 +33,8 @@ namespace using namespace ::testing; using namespace iox::er; -constexpr auto CODE{module_a::errors::Code::OutOfBounds}; -constexpr module_a::errors::Error ERROR{CODE}; +constexpr auto ERROR_CODE{module_a::errors::Code::OutOfBounds}; +constexpr module_a::errors::Error ERROR_MODULE{ERROR_CODE}; // Here we test the custom API that the public API forwards to. // To observe the side effects, this requires using the TestingErrorHandler (similar to the public API). @@ -90,13 +90,13 @@ TEST_F(ErrorReporting_test, reportNonFatalErrorWorks) auto f = []() { constexpr const char* STRINGIFIED_CONDITION{""}; - report(IOX_CURRENT_SOURCE_LOCATION, RUNTIME_ERROR, ERROR, STRINGIFIED_CONDITION); + report(IOX_CURRENT_SOURCE_LOCATION, RUNTIME_ERROR, ERROR_MODULE, STRINGIFIED_CONDITION); }; iox::testing::runInTestThread(f); IOX_TESTING_EXPECT_NO_PANIC(); - IOX_TESTING_EXPECT_ERROR(CODE); + IOX_TESTING_EXPECT_ERROR(ERROR_CODE); } TEST_F(ErrorReporting_test, reportFatalErrorWorks) @@ -105,7 +105,7 @@ TEST_F(ErrorReporting_test, reportFatalErrorWorks) auto f = []() { constexpr const char* STRINGIFIED_CONDITION{""}; - report(IOX_CURRENT_SOURCE_LOCATION, FATAL, ERROR, STRINGIFIED_CONDITION); + report(IOX_CURRENT_SOURCE_LOCATION, FATAL, ERROR_MODULE, STRINGIFIED_CONDITION); }; iox::testing::runInTestThread(f); @@ -113,7 +113,7 @@ TEST_F(ErrorReporting_test, reportFatalErrorWorks) // panic is not required at this level as we cannot trust the custom API to enforce it // While we could also call panic in the custom API, there should only be one decison point // for it at a higher level - IOX_TESTING_EXPECT_ERROR(CODE); + IOX_TESTING_EXPECT_ERROR(ERROR_CODE); } TEST_F(ErrorReporting_test, reportAssertViolatonWorks) diff --git a/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp b/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp index df39d272b3..c08097950c 100644 --- a/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp +++ b/iceoryx_hoofs/test/moduletests/test_vocabulary_expected.cpp @@ -429,10 +429,9 @@ TEST_F(expected_test, CreateWithOkFreeFunctionByForwardingIsSuccessful) TEST_F(expected_test, CreateWithErrFreeFunctionByCopyIsSuccessful) { ::testing::Test::RecordProperty("TEST_ID", "bb641919-e319-4e9c-af67-e1e8d5dab682"); - constexpr TestError ERROR = TestError::ERROR1; - expected sut = err(ERROR); + expected sut = err(TestError::ERROR1); ASSERT_THAT(sut.has_error(), Eq(true)); - EXPECT_THAT(sut.error(), Eq(ERROR)); + EXPECT_THAT(sut.error(), Eq(TestError::ERROR1)); } TEST_F(expected_test, CreateWithErrFreeFunctionByMoveIsSuccessful) @@ -694,10 +693,9 @@ TEST_F(expected_test, CreateFromInPlaceTypeLeadsToValidSut) TEST_F(expected_test, CreateFromUnexpectTypeLeadsToValidSutWithError) { ::testing::Test::RecordProperty("TEST_ID", "20ddbfc0-2235-46c3-9618-dd75e9d3c699"); - constexpr TestError ERROR = TestError::ERROR3; - expected sut{unexpect, ERROR}; + expected sut{unexpect, TestError::ERROR3}; ASSERT_THAT(sut.has_error(), Eq(true)); - EXPECT_THAT(sut.error(), Eq(ERROR)); + EXPECT_THAT(sut.error(), Eq(TestError::ERROR3)); } TEST_F(expected_test, CreateFromEmptySuccessTypeLeadsToValidSut) diff --git a/iceoryx_platform/win/include/iceoryx_platform/platform_correction.hpp b/iceoryx_platform/win/include/iceoryx_platform/platform_correction.hpp index 636b531ce3..31fb3391b0 100644 --- a/iceoryx_platform/win/include/iceoryx_platform/platform_correction.hpp +++ b/iceoryx_platform/win/include/iceoryx_platform/platform_correction.hpp @@ -38,10 +38,8 @@ #undef CreateMutex #undef max #undef min -#undef ERROR #undef interface #undef CreateSemaphore -#undef NO_ERROR #undef OPEN_EXISTING #undef IGNORE #undef OPTIONAL diff --git a/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_base.hpp b/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_base.hpp index b2d4f39bdb..9c29a9cc2a 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_base.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/runtime/ipc_interface_base.hpp @@ -81,7 +81,7 @@ enum class IpcMessageType : int32_t TERMINATION_ACK, PREPARE_APP_TERMINATION, PREPARE_APP_TERMINATION_ACK, - ERROR, + ERROR_RESPONSE, APP_WAIT, WAKEUP_TRIGGER, REPLAY, @@ -90,7 +90,7 @@ enum class IpcMessageType : int32_t END, }; -/// If IpcMessageType::ERROR, this is the sub type for details about the error +/// If IpcMessageType::ERROR_RESPONSE, this is the sub type for details about the error enum class IpcMessageErrorType : int32_t { BEGIN, diff --git a/iceoryx_posh/source/roudi/process_manager.cpp b/iceoryx_posh/source/roudi/process_manager.cpp index dfccfc7224..89f7c55555 100644 --- a/iceoryx_posh/source/roudi/process_manager.cpp +++ b/iceoryx_posh/source/roudi/process_manager.cpp @@ -439,7 +439,7 @@ void ProcessManager::addSubscriberForProcess(const RuntimeName_t& name, else { runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString(runtime::IpcMessageErrorType::SUBSCRIBER_LIST_FULL); process->sendViaIpcChannel(sendBuffer); IOX_LOG(Error, @@ -467,7 +467,7 @@ void ProcessManager::addPublisherForProcess(const RuntimeName_t& name, { // Tell the app no writable shared memory segment was found runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString( runtime::IpcMessageErrorType::REQUEST_PUBLISHER_NO_WRITABLE_SHM_SEGMENT); process->sendViaIpcChannel(sendBuffer); @@ -494,7 +494,7 @@ void ProcessManager::addPublisherForProcess(const RuntimeName_t& name, else { runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); std::string error; switch (maybePublisher.error()) @@ -544,7 +544,7 @@ void ProcessManager::addClientForProcess(const RuntimeName_t& name, { // Tell the app no writable shared memory segment was found runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString( runtime::IpcMessageErrorType::REQUEST_CLIENT_NO_WRITABLE_SHM_SEGMENT); process->sendViaIpcChannel(sendBuffer); @@ -569,7 +569,7 @@ void ProcessManager::addClientForProcess(const RuntimeName_t& name, }) .or_else([&](auto&) { runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString(runtime::IpcMessageErrorType::CLIENT_LIST_FULL); process->sendViaIpcChannel(sendBuffer); @@ -598,7 +598,7 @@ void ProcessManager::addServerForProcess(const RuntimeName_t& name, { // Tell the app no writable shared memory segment was found runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString( runtime::IpcMessageErrorType::REQUEST_SERVER_NO_WRITABLE_SHM_SEGMENT); process->sendViaIpcChannel(sendBuffer); @@ -623,7 +623,7 @@ void ProcessManager::addServerForProcess(const RuntimeName_t& name, }) .or_else([&](auto&) { runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); sendBuffer << runtime::IpcMessageErrorTypeToString(runtime::IpcMessageErrorType::SERVER_LIST_FULL); process->sendViaIpcChannel(sendBuffer); @@ -657,7 +657,7 @@ void ProcessManager::addConditionVariableForProcess(const RuntimeName_t& runtime }) .or_else([&](PortPoolError error) { runtime::IpcMessage sendBuffer; - sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR); + sendBuffer << runtime::IpcMessageTypeToString(runtime::IpcMessageType::ERROR_RESPONSE); if (error == PortPoolError::CONDITION_VARIABLE_LIST_FULL) { sendBuffer << runtime::IpcMessageErrorTypeToString( diff --git a/iceoryx_posh/source/runtime/posh_runtime_impl.cpp b/iceoryx_posh/source/runtime/posh_runtime_impl.cpp index 0619b20f37..78a774080b 100644 --- a/iceoryx_posh/source/runtime/posh_runtime_impl.cpp +++ b/iceoryx_posh/source/runtime/posh_runtime_impl.cpp @@ -255,7 +255,7 @@ PoshRuntimeImpl::requestPublisherFromRoudi(const IpcMessage& sendBuffer) noexcep { std::string IpcMessage1 = receiveBuffer.getElementAtIndex(0U); std::string IpcMessage2 = receiveBuffer.getElementAtIndex(1U); - if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR) + if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR_RESPONSE) { IOX_LOG(Error, "Request publisher received no valid publisher port from RouDi."); return err(stringToIpcMessageErrorType(IpcMessage2.c_str())); @@ -373,7 +373,7 @@ PoshRuntimeImpl::requestSubscriberFromRoudi(const IpcMessage& sendBuffer) noexce std::string IpcMessage1 = receiveBuffer.getElementAtIndex(0U); std::string IpcMessage2 = receiveBuffer.getElementAtIndex(1U); - if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR) + if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR_RESPONSE) { IOX_LOG(Error, "Request subscriber received no valid subscriber port from RouDi."); return err(stringToIpcMessageErrorType(IpcMessage2.c_str())); @@ -485,7 +485,7 @@ PoshRuntimeImpl::requestClientFromRoudi(const IpcMessage& sendBuffer) noexcept { std::string IpcMessage1 = receiveBuffer.getElementAtIndex(0U); std::string IpcMessage2 = receiveBuffer.getElementAtIndex(1U); - if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR) + if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR_RESPONSE) { IOX_LOG(Error, "Request client received no valid client port from RouDi."); return err(stringToIpcMessageErrorType(IpcMessage2.c_str())); @@ -598,7 +598,7 @@ PoshRuntimeImpl::requestServerFromRoudi(const IpcMessage& sendBuffer) noexcept { std::string IpcMessage1 = receiveBuffer.getElementAtIndex(0U); std::string IpcMessage2 = receiveBuffer.getElementAtIndex(1U); - if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR) + if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR_RESPONSE) { IOX_LOG(Error, "Request server received no valid server port from RouDi."); return err(stringToIpcMessageErrorType(IpcMessage2.c_str())); @@ -681,7 +681,7 @@ PoshRuntimeImpl::requestConditionVariableFromRoudi(const IpcMessage& sendBuffer) { std::string IpcMessage1 = receiveBuffer.getElementAtIndex(0U); std::string IpcMessage2 = receiveBuffer.getElementAtIndex(1U); - if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR) + if (stringToIpcMessageType(IpcMessage1.c_str()) == IpcMessageType::ERROR_RESPONSE) { IOX_LOG(Error, "Request condition variable received no valid condition variable port from RouDi."); return err(stringToIpcMessageErrorType(IpcMessage2.c_str()));