mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-21 14:23:03 +01:00
vsnprintf now can take StringView as argument.
This commit is contained in:
@@ -184,6 +184,22 @@ TEST_CASE("vsnprintf t")
|
||||
size_t size = -1;
|
||||
|
||||
REQUIRE(test("-1", "%td", size) );
|
||||
|
||||
REQUIRE(test("3221225472", "%td", size_t(3221225472) ) );
|
||||
}
|
||||
|
||||
TEST_CASE("vsnprintf n")
|
||||
{
|
||||
char temp[64];
|
||||
|
||||
int32_t p0, p1, p2;
|
||||
bx::snprintf(temp, sizeof(temp), "%n", &p0);
|
||||
REQUIRE(0 == p0);
|
||||
|
||||
bx::snprintf(temp, sizeof(temp), "01%n23%n45%n", &p0, &p1, &p2);
|
||||
REQUIRE(2 == p0);
|
||||
REQUIRE(4 == p1);
|
||||
REQUIRE(6 == p2);
|
||||
}
|
||||
|
||||
TEST_CASE("vsnprintf g")
|
||||
@@ -215,6 +231,11 @@ TEST_CASE("vsnprintf")
|
||||
, hello.getLength(), hello.getPtr()
|
||||
, world.getLength(), world.getPtr()
|
||||
) );
|
||||
|
||||
REQUIRE(test("hello, world!", "%S, %S!"
|
||||
, hello
|
||||
, world
|
||||
) );
|
||||
}
|
||||
|
||||
TEST_CASE("vsnprintf write")
|
||||
|
||||
Reference in New Issue
Block a user