Removing dependecy on CRT.

This commit is contained in:
Branimir Karadžić
2017-01-19 00:21:35 -08:00
parent 223d9f7e00
commit b31f3507f2
6 changed files with 228 additions and 88 deletions

View File

@@ -40,6 +40,29 @@ TEST_CASE("strlncpy", "")
REQUIRE(num == 4);
}
TEST_CASE("strincmp", "")
{
REQUIRE(0 == bx::strincmp("test", "test") );
REQUIRE(0 == bx::strincmp("test", "testestes", 4) );
REQUIRE(0 == bx::strincmp("testestes", "test", 4) );
}
TEST_CASE("strnchr", "")
{
const char* test = "test";
REQUIRE(NULL == bx::strnchr(test, 's', 0) );
REQUIRE(NULL == bx::strnchr(test, 's', 2) );
REQUIRE(&test[2] == bx::strnchr(test, 's') );
}
TEST_CASE("strnrchr", "")
{
const char* test = "test";
REQUIRE(NULL == bx::strnrchr(test, 's', 0) );
REQUIRE(NULL == bx::strnrchr(test, 's', 1) );
REQUIRE(&test[2] == bx::strnrchr(test, 's') );
}
TEST_CASE("StringView", "")
{
bx::StringView sv("test");