From 529fac6c757c3c596345f9df66414f98c5603b4b Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Wed, 30 Oct 2024 23:05:33 -0700 Subject: [PATCH] test databuf::forceoverread --- test/testutils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testutils.cpp b/test/testutils.cpp index d1ff82b1..34c02d99 100644 --- a/test/testutils.cpp +++ b/test/testutils.cpp @@ -612,6 +612,15 @@ namespace assert(d.check(3) == true); } + void test_databuf_forceoverread() + { + std::printf("Testing databuf<>::overwrote\n"); + std::array buf; + databuf d(buf.data(),4); + d.forceoverread(); + assert(d.overread() == true); + } + void test_stream_overloadable() { std::printf("Testing virtual overloadable std::stream methods:\ntell\nrawtell\nseek\nread\nwrite\nflush\ngetcrc\n"); @@ -674,5 +683,6 @@ testing tools functionality\n\ test_databuf_empty(); test_databuf_remaining(); test_databuf_check(); + test_databuf_forceoverread(); test_stream_overloadable(); }