forked from arduino/ArduinoCore-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_getWriteError.cpp
More file actions
30 lines (23 loc) · 797 Bytes
/
Copy pathtest_getWriteError.cpp
File metadata and controls
30 lines (23 loc) · 797 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
27
28
29
30
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <catch.hpp>
#include <Print.h>
#include <PrintMock.h>
/**************************************************************************************
* TEST CODE
**************************************************************************************/
TEST_CASE ("No write error has been set", "[Print-getWriteError-01]")
{
PrintMock mock;
REQUIRE(mock.getWriteError() == 0);
}
TEST_CASE ("A write error has been set", "[Print-getWriteError-02]")
{
PrintMock mock;
mock.mock_setWriteError(5);
REQUIRE(mock.getWriteError() == 5);
}