This commit is contained in:
Dmitry Borisenko
2021-12-22 14:06:24 +01:00
parent 1ed5c81eb7
commit 5e9b15e7de
483 changed files with 0 additions and 28088 deletions

View File

@@ -1,30 +0,0 @@
// StreamUtils - github.com/bblanchon/ArduinoStreamUtils
// Copyright Benoit Blanchon 2019-2021
// MIT License
#include "SpyingAllocator.hpp"
#include "StreamUtils/Streams/HammingEncodingStream.hpp"
#include "StreamUtils/Streams/MemoryStream.hpp"
#include "doctest.h"
using namespace StreamUtils;
TEST_CASE("HammingEncodingStream") {
MemoryStream upstream(64);
HammingEncodingStream<7, 4> stream{upstream};
SUBCASE("read() forwards upstream data") {
upstream.print("A");
CHECK(stream.read() == 'A');
}
SUBCASE("write() encodes") {
stream.write('A');
CHECK(upstream.readString() == "Tq");
}
}