diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp index 573be71256..c9208ca229 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef IOX_POPO_CHUNK_DISTRIBUTOR_HPP_ +#define IOX_POPO_CHUNK_DISTRIBUTOR_HPP_ #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp" @@ -119,3 +120,5 @@ class ChunkDistributor } // namespace iox #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor.inl" + +#endif diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp index 0db21fbb3d..1afbed0f88 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor_data.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef IOX_POPO_CHUNK_DISTRIBUTOR_DATA_HPP_ +#define IOX_POPO_CHUNK_DISTRIBUTOR_DATA_HPP_ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/log/posh_logging.hpp" @@ -94,3 +95,5 @@ struct ChunkDistributorData : public LockingPolicy } // namespace popo } // namespace iox + +#endif \ No newline at end of file diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue.hpp index e55ee9170c..e0f35c04b1 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef IOX_POPO_CHUNK_QUEUE_HPP_ +#define IOX_POPO_CHUNK_QUEUE_HPP_ #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp" @@ -100,3 +101,5 @@ class ChunkQueue } // namespace popo } // namespace iox + +#endif \ No newline at end of file diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp index ce3583b9e7..376ec76e32 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_queue_data.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef IOX_POPO_CHUNK_QUEUE_DATA_HPP_ +#define IOX_POPO_CHUNK_QUEUE_DATA_HPP_ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_utils/cxx/variant_queue.hpp" @@ -53,3 +54,5 @@ struct ChunkQueueData } // namespace popo } // namespace iox + +#endif \ No newline at end of file diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp index bea7dc091c..c6e9c02995 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef IOX_POSH_POPO_CHUNK_RECEIVER_HPP_ -#define IOX_POSH_POPO_CHUNK_RECEIVER_HPP_ +#ifndef IOX_POPO_CHUNK_RECEIVER_HPP_ +#define IOX_POPO_CHUNK_RECEIVER_HPP_ #include "iceoryx_posh/internal/popo/building_blocks/chunk_queue.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp" diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp index 2836fa8271..3d173003b4 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_receiver_data.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef IOX_POSH_POPO_CHUNK_RECEIVER_DATA_HPP_ -#define IOX_POSH_POPO_CHUNK_RECEIVER_DATA_HPP_ +#ifndef IOX_POPO_CHUNK_RECEIVER_DATA_HPP_ +#define IOX_POPO_CHUNK_RECEIVER_DATA_HPP_ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp index 89192ac97d..8d58659fc6 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef IOX_POSH_POPO_CHUNK_SENDER_HPP_ -#define IOX_POSH_POPO_CHUNK_SENDER_HPP_ +#ifndef IOX_POPO_CHUNK_SENDER_HPP_ +#define IOX_POPO_CHUNK_SENDER_HPP_ #include "iceoryx_posh/internal/mepoo/shared_chunk.hpp" #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp" diff --git a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp index 8fdceb8c04..2129b5cd06 100644 --- a/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp +++ b/iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_sender_data.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef IOX_POSH_POPO_CHUNK_SENDER_DATA_HPP_ -#define IOX_POSH_POPO_CHUNK_SENDER_DATA_HPP_ +#ifndef IOX_POPO_CHUNK_SENDER_DATA_HPP_ +#define IOX_POPO_CHUNK_SENDER_DATA_HPP_ #include "iceoryx_posh/iceoryx_posh_types.hpp" #include "iceoryx_posh/internal/mepoo/memory_manager.hpp" diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp index 6cb7b99f2a..1d7b6427dd 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_receiver.cpp @@ -30,16 +30,16 @@ struct DummySample uint64_t dummy{42}; }; -class ChunkReceiver_testBase : public Test +class ChunkReceiver_test : public Test { protected: - ChunkReceiver_testBase() + ChunkReceiver_test() { m_mempoolconf.addMemPool({CHUNK_SIZE, NUM_CHUNKS_IN_POOL}); m_memoryManager.configureMemoryManager(m_mempoolconf, &m_memoryAllocator, &m_memoryAllocator); } - ~ChunkReceiver_testBase() + ~ChunkReceiver_test() { } @@ -52,7 +52,7 @@ class ChunkReceiver_testBase : public Test } static constexpr size_t MEMORY_SIZE = 1024 * 1024; - uint8_t m_memory[1024 * 1024]; + uint8_t m_memory[MEMORY_SIZE]; static constexpr uint32_t NUM_CHUNKS_IN_POOL = iox::MAX_CHUNKS_HELD_PER_RECEIVER + iox::MAX_RECEIVER_QUEUE_CAPACITY; static constexpr uint32_t CHUNK_SIZE = 128; @@ -64,15 +64,6 @@ class ChunkReceiver_testBase : public Test iox::popo::ChunkReceiver m_chunkReceiver{&m_chunkReceiverData}; }; -class ChunkReceiver_test : public ChunkReceiver_testBase -{ - public: - ChunkReceiver_test() - : ChunkReceiver_testBase() - { - } -}; - TEST_F(ChunkReceiver_test, getNoChunkFromEmptyQueue) { auto getRet = m_chunkReceiver.get(); diff --git a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp index 008447a8e2..128cdd04de 100644 --- a/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp +++ b/iceoryx_posh/test/moduletests/test_popo_chunk_sender.cpp @@ -34,17 +34,17 @@ struct DummySample uint64_t dummy{42}; }; -class ChunkSender_testBase : public Test +class ChunkSender_test : public Test { protected: - ChunkSender_testBase() + ChunkSender_test() { m_mempoolconf.addMemPool({SMALL_CHUNK, NUM_CHUNKS_IN_POOL}); m_mempoolconf.addMemPool({BIG_CHUNK, NUM_CHUNKS_IN_POOL}); m_memoryManager.configureMemoryManager(m_mempoolconf, &m_memoryAllocator, &m_memoryAllocator); } - ~ChunkSender_testBase() + ~ChunkSender_test() { } @@ -57,7 +57,7 @@ class ChunkSender_testBase : public Test } static constexpr size_t MEMORY_SIZE = 1024 * 1024; - uint8_t m_memory[1024 * 1024]; + uint8_t m_memory[MEMORY_SIZE]; static constexpr uint32_t NUM_CHUNKS_IN_POOL = 20; static constexpr uint32_t SMALL_CHUNK = 128; static constexpr uint32_t BIG_CHUNK = 256; @@ -74,20 +74,11 @@ class ChunkSender_testBase : public Test iox::popo::ChunkSenderData m_chunkSenderData{&m_memoryManager, 0}; // must be 0 for test iox::popo::ChunkSenderData m_chunkSenderDataWithHistory{&m_memoryManager, HISTORY_CAPACITY}; - using ChunkDistributor_t = iox::popo::ChunkDistributor; + using ChunkDistributor_t = iox::popo::ChunkDistributor; iox::popo::ChunkSender m_chunkSender{&m_chunkSenderData}; iox::popo::ChunkSender m_chunkSenderWithHistory{&m_chunkSenderDataWithHistory}; }; -class ChunkSender_test : public ChunkSender_testBase -{ - public: - ChunkSender_test() - : ChunkSender_testBase() - { - } -}; - TEST_F(ChunkSender_test, allocate_OneChunk) { auto chunk = m_chunkSender.allocate(sizeof(DummySample));