Skip to content

Commit 4bd4018

Browse files
committedNov 3, 2020
Adding test code for Print::availableForWrite
1 parent c4a6cc7 commit 4bd4018

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
 

‎test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ set(TEST_SRCS
3939
src/Print/test_getWriteError.cpp
4040
src/Print/test_print.cpp
4141
src/Print/test_println.cpp
42+
src/Print/test_availableForWrite.cpp
4243
src/Ringbuffer/test_available.cpp
4344
src/Ringbuffer/test_availableForStore.cpp
4445
src/Ringbuffer/test_clear.cpp
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2020 Arduino. All rights reserved.
3+
*/
4+
5+
/**************************************************************************************
6+
* INCLUDE
7+
**************************************************************************************/
8+
9+
#include <catch.hpp>
10+
11+
#include <Print.h>
12+
13+
#include <PrintMock.h>
14+
15+
/**************************************************************************************
16+
* TEST CODE
17+
**************************************************************************************/
18+
19+
TEST_CASE ("Print::availableForWrite() should return 0 if not overwritten by derived class", "[Print-availableForWrite-01]")
20+
{
21+
PrintMock mock;
22+
REQUIRE(mock.availableForWrite() == 0);
23+
}

0 commit comments

Comments
 (0)
Please sign in to comment.