|
|
@ -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", "[]" ) {
|
|
|
|
TEST_CASE("space flag", "[]" ) {
|
|
|
|
char buffer[100];
|
|
|
|
char buffer[100];
|
|
|
|
|
|
|
|
|
|
|
|