diff --git a/iceoryx_binding_c/test/moduletests/test_runtime.cpp b/iceoryx_binding_c/test/moduletests/test_runtime.cpp index 08b6162c80..854cd62c78 100644 --- a/iceoryx_binding_c/test/moduletests/test_runtime.cpp +++ b/iceoryx_binding_c/test/moduletests/test_runtime.cpp @@ -66,14 +66,17 @@ TEST_F(BindingC_Runtime_test, SuccessfulRegistration) TEST_F(BindingC_Runtime_test, RuntimeNameLengthIsMax) { ::testing::Test::RecordProperty("TEST_ID", "854a471d-936e-4c98-b56e-ba8a7d83460e"); - std::string maxName(iox::MAX_RUNTIME_NAME_LENGTH, 's'); + + RuntimeName_t dummy{"a"}; + auto prefixLength = runtime::ipcChannelNameToInterfaceName(dummy).value().size() - dummy.size(); + std::string maxName(iox::MAX_RUNTIME_NAME_LENGTH - prefixLength, 's'); iox_runtime_init(maxName.c_str()); char actualRuntimeName[iox::MAX_RUNTIME_NAME_LENGTH + 1]; auto nameLength = iox_runtime_get_instance_name(actualRuntimeName, iox::MAX_RUNTIME_NAME_LENGTH + 1); - ASSERT_THAT(nameLength, Eq(iox::MAX_RUNTIME_NAME_LENGTH)); + ASSERT_THAT(nameLength, Eq(iox::MAX_RUNTIME_NAME_LENGTH - prefixLength)); } TEST_F(BindingC_Runtime_test, RuntimeNameLengthIsOutOfLimit) diff --git a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp index 2d7ad28ff4..c410bae814 100644 --- a/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp +++ b/iceoryx_posh/test/moduletests/test_mepoo_segment.cpp @@ -154,14 +154,16 @@ TEST_F(MePooSegment_test, SharedMemoryCreationParameter) ::testing::Test::RecordProperty("TEST_ID", "0fcfefd4-3a84-43a5-9805-057a60239184"); GTEST_SKIP_FOR_ADDITIONAL_USER() << "This test requires the -DTEST_WITH_ADDITIONAL_USER=ON cmake argument"; - MePooSegment_test::SharedMemoryObject_MOCK::createVerificator = [](const detail::PosixSharedMemory::Name_t f_name, + MePooSegment_test::SharedMemoryObject_MOCK::createVerificator = [](const detail::PosixSharedMemory::Name_t name, const uint64_t, - const iox::AccessMode f_accessMode, + const iox::AccessMode accessMode, const iox::OpenMode openMode, const void*, const iox::access_rights) { - EXPECT_THAT(f_name, Eq(detail::PosixSharedMemory::Name_t("iox_roudi_test2"))); - EXPECT_THAT(f_accessMode, Eq(iox::AccessMode::READ_WRITE)); + EXPECT_THAT(name, + Eq(detail::PosixSharedMemory::Name_t( + concatenate(iceoryxResourcePrefix(roudi::DEFAULT_UNIQUE_ROUDI_ID, "p"), "iox_roudi_test2")))); + EXPECT_THAT(accessMode, Eq(iox::AccessMode::READ_WRITE)); EXPECT_THAT(openMode, Eq(iox::OpenMode::PURGE_AND_CREATE)); }; SUT sut{mepooConfig, m_managementAllocator, PosixGroup{"iox_roudi_test1"}, PosixGroup{"iox_roudi_test2"}};