mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
vsnprintf: Added null string unit test.
This commit is contained in:
@@ -38,7 +38,7 @@ static bool test(const char* _expected, const char* _format, ...)
|
||||
|
||||
if (!result)
|
||||
{
|
||||
printf("result (%d) %s, expected (%d) %s\n", len, temp, max-1, _expected);
|
||||
printf("result (%d) '%s', expected (%d) '%s'\n", len, temp, max-1, _expected);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -89,6 +89,11 @@ TEST_CASE("vsnprintf p", "")
|
||||
REQUIRE(test("0xbadc0de ", "%-20p", (void*)0xbadc0de) );
|
||||
}
|
||||
|
||||
TEST_CASE("vsnprintf s", "")
|
||||
{
|
||||
REQUIRE(test("(null)", "%s", NULL) );
|
||||
}
|
||||
|
||||
TEST_CASE("vsnprintf", "")
|
||||
{
|
||||
REQUIRE(test("x", "%c", 'x') );
|
||||
|
||||
Reference in New Issue
Block a user