forked from arduino/ArduinoCore-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrintableMock.h
33 lines (26 loc) · 837 Bytes
/
PrintableMock.h
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
32
33
/*
* Copyright (c) 2020 Arduino. All rights reserved.
*/
#ifndef PRINTABLE_MOCK_H_
#define PRINTABLE_MOCK_H_
/**************************************************************************************
* INCLUDE
**************************************************************************************/
#include <string>
#include <api/Printable.h>
/**************************************************************************************
* CLASS DECLARATION
**************************************************************************************/
class PrintableMock : public arduino::Printable
{
public:
int _i;
virtual size_t printTo(arduino::Print& p) const override
{
size_t written = 0;
written += p.print("PrintableMock i = ");
written += p.print(_i);
return written;
}
};
#endif /* PRINTABLE_MOCK_H_ */