Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1821 Add test to show the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasblass committed Dec 8, 2022
1 parent 6b11c9a commit 27782ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions iceoryx_hoofs/test/moduletests/test_posix_shared_memory_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ TEST_F(SharedMemoryObject_Test, CTorOpenNonExistingSharedMemoryObject)
EXPECT_THAT(sut.has_error(), Eq(true));
}

TEST_F(SharedMemoryObject_Test, CTorCreateReadOnlySharedMemoryObject)
{
::testing::Test::RecordProperty("TEST_ID", "80684160-b243-4ca1-b285-118d2ef36108");
auto sut = iox::posix::SharedMemoryObjectBuilder()
.name("readOnlyShmMem")
.memorySizeInBytes(100)
.accessMode(iox::posix::AccessMode::READ_ONLY)
.openMode(iox::posix::OpenMode::PURGE_AND_CREATE)
.create();

// TODO(tobias.stark): Check that the right error is returned, not just any error.
// But what is the right error?
EXPECT_THAT(sut.has_error(), Eq(true));
}

TEST_F(SharedMemoryObject_Test, AllocateMemoryInSharedMemoryAndReadIt)
{
::testing::Test::RecordProperty("TEST_ID", "6169ac70-a08e-4a19-80e4-57f0d5f89233");
Expand Down

0 comments on commit 27782ca

Please sign in to comment.