provided read/write method for adapaters that accepts number of bytes at

compile-time
This commit is contained in:
Mindaugas Vinkelis
2020-01-29 15:08:25 +02:00
parent ee68261124
commit d24dfe14f5
9 changed files with 187 additions and 96 deletions

View File

@@ -502,13 +502,13 @@ using BufferedAdapterInternalBufferTypes = ::testing::Types<
TYPED_TEST_CASE(OutputStreamBuffered, BufferedAdapterInternalBufferTypes);
TYPED_TEST(OutputStreamBuffered, WhenInternalBufferIsFullThenWriteBufferAndRemainingDataToStream) {
TYPED_TEST(OutputStreamBuffered, WhenInternalBufferIsFullThenWriteBufferToStream) {
uint8_t x{};
for (auto i = 0u; i < TestFixture::InternalBufferSize; ++i)
this->writer.template writeBytes<1>(x);
EXPECT_TRUE(this->stream.str().empty());
this->writer.template writeBytes<1>(x);
EXPECT_THAT(this->stream.str().size(), Eq(TestFixture::InternalBufferSize + 1));
EXPECT_THAT(this->stream.str().size(), Eq(TestFixture::InternalBufferSize));
}
TYPED_TEST(OutputStreamBuffered, WhenFlushThenWriteImmediately) {