From 23b2e071322ffd8235d0609f1c6e8195dd11e0ca Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 11 Jul 2019 13:38:58 +0200 Subject: [PATCH] Add basic testing for _push_move method --- tests/test-mbuffer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test-mbuffer.c b/tests/test-mbuffer.c index 5d049e1c..1f37bb93 100644 --- a/tests/test-mbuffer.c +++ b/tests/test-mbuffer.c @@ -472,6 +472,16 @@ static void test_spsc(void) assert(j == 16); for(unsigned i = 0; i < 16; i++) assert( tab[i] == i * i); + + do { + b = squeue_uint_pop(&j, q); + } while (b); + assert(squeue_uint_empty_p(q)); + b = squeue_uint_push_move(q, 65536); + assert(b); + b = squeue_uint_pop(&j, q); + assert(b); + assert(j == 65536); squeue_uint_clear(q); }