Skip to content

Commit

Permalink
test putint(databuf)
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 22, 2024
1 parent 92f8b88 commit 2565205
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,22 @@ namespace
assert(v.size() == 0);
}

void test_databuf_putint()
{
std::printf("Testing putfloat/getint (databuf)\n");

std::array<uchar, 100> buf;
ucharbuf v(buf.data(),100);

putint(v, 3);
v.reset();
assert(getint(v) == 3);
v.reset();
putint(v, -999);
v.reset();
assert(getint(v) == -999);
}

void test_vector_putfloat()
{
std::printf("Testing putfloat/getfloat (std::vector)\n");
Expand Down Expand Up @@ -406,6 +422,7 @@ testing tools functionality\n\
testparentdir();
testfixpackagedir();
test_vector_putint();
test_databuf_putint();
test_vector_putfloat();
test_databuf_putfloat();
test_databuf_pad();
Expand Down

0 comments on commit 2565205

Please sign in to comment.