mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
compiling
This commit is contained in:
30
lib/ArduinoStreamUtils/extras/test/HammingClientTest.cpp
Normal file
30
lib/ArduinoStreamUtils/extras/test/HammingClientTest.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// StreamUtils - github.com/bblanchon/ArduinoStreamUtils
|
||||
// Copyright Benoit Blanchon 2019-2021
|
||||
// MIT License
|
||||
|
||||
#include "SpyingAllocator.hpp"
|
||||
|
||||
#include "StreamUtils/Clients/HammingClient.hpp"
|
||||
#include "StreamUtils/Clients/MemoryClient.hpp"
|
||||
|
||||
#include "doctest.h"
|
||||
|
||||
using namespace StreamUtils;
|
||||
|
||||
TEST_CASE("HammingClient") {
|
||||
MemoryClient upstream(64);
|
||||
|
||||
HammingClient<7, 4> client{upstream};
|
||||
|
||||
SUBCASE("read() decodes") {
|
||||
upstream.print("Tq");
|
||||
|
||||
CHECK(client.read() == 'A');
|
||||
}
|
||||
|
||||
SUBCASE("write() encodes") {
|
||||
client.write('A');
|
||||
|
||||
CHECK(upstream.readString() == "Tq");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user