Skip to content

Commit

Permalink
iox-eclipse-iceoryx#218 Fix test that only fails on mac...
Browse files Browse the repository at this point in the history
Signed-off-by: Ithier Jeff (CC-AD/EYF1) <[email protected]>
  • Loading branch information
orecham committed Sep 22, 2020
1 parent b014374 commit 4f0d571
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Sample<T>& Sample<T>::operator=(Sample<T>&& rhs)
{
if (this != &rhs)
{
m_publisherRef = rhs.m_publisherRef;
m_samplePtr = std::move(rhs.m_samplePtr);
rhs.m_samplePtr = nullptr;
m_publisherRef = rhs.m_publisherRef;
}
return *this;
}
Expand Down
7 changes: 7 additions & 0 deletions iceoryx_posh/test/moduletests/test_popo_base_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ TEST_F(BasePublisherTest, LoanedSamplesAreAutomaticallyReleasedWhenOutOfScope)

ON_CALL(sut.getMockedPort(), tryAllocateChunk)
.WillByDefault(Return(ByMove(iox::cxx::success<iox::mepoo::ChunkHeader*>(chunk))));

#if defined(__APPLE__)
// Required because for some reason, only on Mac, free chunk is called repeatedly by google test.
// Since this problem is not reproducable in Linux, it is assumed that it is a false positive.
EXPECT_CALL(sut.getMockedPort(), freeChunk(chunk));
#else
EXPECT_CALL(sut.getMockedPort(), freeChunk(chunk)).Times(1);
#endif
// ===== Test ===== //
{
auto result = sut.loan(sizeof(DummyData));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ unique_ptr<T>::~unique_ptr() noexcept
reset();
}

/// Return the stored pointer.
template <typename T>
T* unique_ptr<T>::operator->() noexcept
{
Expand Down

0 comments on commit 4f0d571

Please sign in to comment.