Skip to content

Commit

Permalink
test putint/getint (vector)
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Oct 16, 2024
1 parent d64f82e commit 9146571
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/testutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ namespace
std::printf("test string length: %lu\n" , std::strlen(s));
assert(std::strlen(s) == std::strlen(s1) + std::strlen(s2));
}

void test_vector_putint()
{
std::printf("Testing putint/getint (std::vector)\n");

std::vector<uchar> v;
putint(v, 3);
assert(getint(v) == 3);
assert(v.size() == 0);
putint(v, -999);
assert(getint(v) == -999);
assert(v.size() == 0);
}
}

void testutils()
Expand All @@ -248,4 +261,5 @@ void testutils()
testconcatstring();
testparentdir();
testfixpackagedir();
test_vector_putint();
}

0 comments on commit 9146571

Please sign in to comment.