|
|
@@ -19,6 +19,27 @@ TEST_CASE("strnlen", "")
|
|
|
REQUIRE(4 == bx::strnlen(test, UINT32_MAX) );
|
|
|
}
|
|
|
|
|
|
+TEST_CASE("strlncpy", "")
|
|
|
+{
|
|
|
+ char dst[128];
|
|
|
+ size_t num;
|
|
|
+
|
|
|
+ num = bx::strlncpy(dst, 1, "blah");
|
|
|
+ REQUIRE(num == 0);
|
|
|
+
|
|
|
+ num = bx::strlncpy(dst, 3, "blah", 3);
|
|
|
+ REQUIRE(0 == strcmp(dst, "bl") );
|
|
|
+ REQUIRE(num == 2);
|
|
|
+
|
|
|
+ num = bx::strlncpy(dst, sizeof(dst), "blah", 3);
|
|
|
+ REQUIRE(0 == strcmp(dst, "bla") );
|
|
|
+ REQUIRE(num == 3);
|
|
|
+
|
|
|
+ num = bx::strlncpy(dst, sizeof(dst), "blah");
|
|
|
+ REQUIRE(0 == strcmp(dst, "blah") );
|
|
|
+ REQUIRE(num == 4);
|
|
|
+}
|
|
|
+
|
|
|
TEST_CASE("StringView", "")
|
|
|
{
|
|
|
bx::StringView sv("test");
|