MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test_CircularBufferInit

Function test_CircularBufferInit

tests/unit/test_circular_buffer.c:18–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include "acutest.h"
17
18void test_CircularBufferInit(void) {
19 CircularBuffer buff = CircularBuffer_New(sizeof(int), 16);
20
21 // a new circular buffer should be empty
22 TEST_ASSERT(CircularBuffer_Empty(buff) == true);
23
24 // item count of an empty circular buffer should be 0
25 TEST_ASSERT(CircularBuffer_ItemCount(buff) == 0);
26
27 // buffer should have available slots in it i.e. not full
28 TEST_ASSERT(CircularBuffer_Full(buff) == false);
29
30 // clean up
31 CircularBuffer_Free(buff);
32}
33
34void test_CircularBufferPopulation(void) {
35 int n;

Callers

nothing calls this directly

Calls 5

CircularBuffer_NewFunction · 0.85
CircularBuffer_EmptyFunction · 0.85
CircularBuffer_ItemCountFunction · 0.85
CircularBuffer_FullFunction · 0.85
CircularBuffer_FreeFunction · 0.85

Tested by

no test coverage detected