Skip to content

Commit

Permalink
test databuf::getbuf
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 20, 2024
1 parent a9e3eea commit 19d8df8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@ namespace
assert(d.length() == 0);
}

void test_databuf_getbuf()
{
std::printf("Testing databuf<>::getbuf\n");
std::array<int, 4> buf;
databuf<int> d(buf.data(),4);
int *dbuf = d.getbuf();
assert(dbuf == buf.data());
}

void test_databuf_empty()
{
std::printf("Testing databuf<>::empty\n");
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 19d8df8

Please sign in to comment.