Skip to content

Commit 78e7dc2

Browse files
adapting unit tests to use ReturnValue class
1 parent 300339a commit 78e7dc2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/include/StreamMock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class StreamMock : public arduino::Stream
2626
void operator << (char const * str);
2727

2828
virtual size_t write(uint8_t ch) override;
29-
virtual int available() override;
30-
virtual int read() override;
31-
virtual int peek() override;
29+
arduino::ReturnValue available() override;
30+
arduino::ReturnValue read() override;
31+
arduino::ReturnValue peek() override;
3232

3333
private:
3434
std::deque<char> _stream;

test/src/StreamMock.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ void StreamMock::operator << (char const * str)
2121
}
2222

2323
size_t StreamMock::write(uint8_t ch)
24-
{
24+
{
2525
_stream.push_back(static_cast<char>(ch));
2626
return 1;
2727
}
2828

29-
int StreamMock::available()
29+
arduino::ReturnValue StreamMock::available()
3030
{
3131
return _stream.size();
3232
}
3333

34-
int StreamMock::read()
34+
arduino::ReturnValue StreamMock::read()
3535
{
3636
if (available() == 0)
3737
return -1;
@@ -44,7 +44,7 @@ int StreamMock::read()
4444
return c;
4545
}
4646

47-
int StreamMock::peek()
47+
arduino::ReturnValue StreamMock::peek()
4848
{
4949
if (available() == 0)
5050
return -1;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy