From 370e9115e4888c2f2568f61795c7ee41886e6c65 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Sun, 3 Jul 2022 14:37:08 +0200 Subject: [PATCH] Fix circular buffer off-by-one bug in test --- FlashMQTests/tst_maintests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FlashMQTests/tst_maintests.cpp b/FlashMQTests/tst_maintests.cpp index ce53660..6f7ad13 100644 --- a/FlashMQTests/tst_maintests.cpp +++ b/FlashMQTests/tst_maintests.cpp @@ -228,9 +228,10 @@ void MainTests::test_circbuf_unwrapped_doubling() { QCOMPARE(tail[i], i+1); } - QCOMPARE(buf.buf[64], 0); // Vacant place, because of the circulerness. + QCOMPARE(buf.buf[63], 0); // Vacant place, because of the circulerness. MYCASTCOMPARE(buf.head, 63); + QCOMPARE(buf.freeSpace(), 0); buf.doubleSize(); tail = buf.tailPtr(); -- libgit2 0.21.4