forked from arduino/ArduinoCore-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_store_char.cpp
More file actions
26 lines (21 loc) · 844 Bytes
/
Copy pathtest_store_char.cpp
File metadata and controls
26 lines (21 loc) · 844 Bytes
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
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch2/catch_test_macros.hpp>
#include <api/RingBuffer.h>
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("Data is put into the ring buffer via 'store_char'", "[Ringbuffer-store_char-01]")
{
arduino::RingBufferN<2> ringbuffer;
ringbuffer.store_char('A');
REQUIRE(ringbuffer._aucBuffer[0] == 'A');
ringbuffer.store_char('B');
REQUIRE(ringbuffer._aucBuffer[1] == 'B');
}