Skip to content

Commit

Permalink
test databuf::remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 20, 2024
1 parent 40045f3 commit f011b6e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ namespace
d.put(3);
assert(d.empty() == false);
}

void test_databuf_remaining()
{
std::printf("Testing databuf<>::remaining\n");
std::array<int, 4> buf;
databuf<int> d(buf.data(),4);
assert(d.remaining() == 4);
d.put(3);
assert(d.remaining() == 3);
}
}

void testutils()
Expand All @@ -340,4 +350,5 @@ testing tools functionality\n\
test_databuf_get();
test_databuf_reset();
test_databuf_empty();
test_databuf_remaining();
}

0 comments on commit f011b6e

Please sign in to comment.