-
-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathtest_isFull.cpp
31 lines (24 loc) · 913 Bytes
/
test_isFull.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch.hpp>
#include <vector>
#include <RingBuffer.h>
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("'isFull' should return false for empty ring buffer", "[Ringbuffer-isFull-01]")
{
arduino::RingBufferN<2> ringbuffer;
REQUIRE(ringbuffer.isFull() == false);
}
TEST_CASE ("'isFull' should return true for full ring buffer", "[Ringbuffer-isFull-02]")
{
arduino::RingBufferN<2> ringbuffer;
ringbuffer.store_char('A');
ringbuffer.store_char('B');
REQUIRE(ringbuffer.isFull() == true);
}