1
0
Fork 0

test(test_suite): added vsnprintf() test case

development
Marco Paland 7 years ago
parent 9fa6e64941
commit 7616d6f5e7

@ -83,6 +83,24 @@ TEST_CASE("snprintf", "[]" ) {
}
TEST_CASE("vsnprintf", "[]" ) {
char buffer[100];
// mock argument list
const struct tag_args {
int a;
int b;
char* s;
} args = { -1, -1000, "test" };
test::vsnprintf(buffer, 100U, "%d %d %s", (char*)&args);
REQUIRE(!strcmp(buffer, "-1 -1000 test"));
test::vsnprintf(buffer, 3U, "%d", (char*)&args);
REQUIRE(!strcmp(buffer, "-1"));
}
TEST_CASE("space flag", "[]" ) {
char buffer[100];

Loading…
Cancel
Save