File tree Expand file tree Collapse file tree 3 files changed +48
-1
lines changed
Expand file tree Collapse file tree 3 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ project(test-ArduinoCore-API)
99##########################################################################
1010
1111include_directories (../api)
12+ include_directories (include )
1213include_directories (external/catch/v2.13.1/include )
1314
1415##########################################################################
@@ -57,8 +58,8 @@ set(TEST_TARGET_SRCS
5758 src/main.cpp
5859 src/dtostrf.cpp
5960 src/itoa.cpp
61+ src/PrintMock.cpp
6062 ${TEST_SRCS}
61- ${TEST_UTIL_SRCS}
6263 ${TEST_DUT_SRCS}
6364)
6465
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2020 Arduino. All rights reserved.
3+ */
4+
5+ #ifndef PRINT_MOCK_H_
6+ #define PRINT_MOCK_H_
7+
8+ /* *************************************************************************************
9+ * INCLUDE
10+ **************************************************************************************/
11+
12+ #include < string>
13+
14+ #include < Print.h>
15+
16+ /* *************************************************************************************
17+ * CLASS DECLARATION
18+ **************************************************************************************/
19+
20+ class PrintMock : public Print
21+ {
22+ public:
23+ std::string _str;
24+ virtual size_t write (uint8_t b) override ;
25+ };
26+
27+ #endif /* PRINT_MOCK_H_ */
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2020 Arduino. All rights reserved.
3+ */
4+
5+ /* *************************************************************************************
6+ * INCLUDE
7+ **************************************************************************************/
8+
9+ #include < PrintMock.h>
10+
11+ /* *************************************************************************************
12+ * PUBLIC MEMBER FUNCTIONS
13+ **************************************************************************************/
14+
15+ size_t PrintMock::write (uint8_t b)
16+ {
17+ _str.append (1 , static_cast <char >(b));
18+ return 1 ;
19+ }
You can’t perform that action at this time.
0 commit comments