From 19d8df8d4476e42958c55423badc7536e72d2c77 Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Sat, 19 Oct 2024 23:53:26 -0700 Subject: [PATCH] test databuf::getbuf --- test/testutils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/testutils.cpp b/test/testutils.cpp index a49d8e88..d85788dd 100644 --- a/test/testutils.cpp +++ b/test/testutils.cpp @@ -308,6 +308,15 @@ namespace assert(d.length() == 0); } + void test_databuf_getbuf() + { + std::printf("Testing databuf<>::getbuf\n"); + std::array buf; + databuf d(buf.data(),4); + int *dbuf = d.getbuf(); + assert(dbuf == buf.data()); + } + void test_databuf_empty() { std::printf("Testing databuf<>::empty\n"); @@ -361,6 +370,7 @@ testing tools functionality\n\ test_databuf_put(); test_databuf_get(); test_databuf_reset(); + test_databuf_getbuf(); test_databuf_empty(); test_databuf_remaining(); test_databuf_check();