From b87d2fdfec9eb9dcb1f17a9dced133151ff70e84 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 29 Apr 2020 11:32:20 +0200 Subject: [PATCH] Add test for a full queue --- core-buffer/test/test_FastQueue.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core-buffer/test/test_FastQueue.cpp b/core-buffer/test/test_FastQueue.cpp index 6dab0c4..74b3ecb 100644 --- a/core-buffer/test/test_FastQueue.cpp +++ b/core-buffer/test/test_FastQueue.cpp @@ -45,5 +45,27 @@ TEST(FastQueue, basic_interaction) TEST(FastQueue, queue_full) { + size_t n_slots = 5; + size_t slot_data_n_bytes = MODULE_N_BYTES * 2; + FastQueue queue(slot_data_n_bytes, n_slots); + // There is nothing to be read in the queue. + ASSERT_EQ(queue.read(), -1); + + for (size_t i=0; i