feat(string): add SStrCmpI

This commit is contained in:
fallenoak 2020-11-15 12:47:41 -06:00
parent 0d07d79ed0
commit 7aa414f95a
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
3 changed files with 24 additions and 0 deletions

View file

@ -20,6 +20,23 @@ TEST_CASE("SStrCmp", "[string]") {
}
}
TEST_CASE("SStrCmpI", "[string]") {
SECTION("compares two strings that exactly match correctly") {
auto compare = SStrCmpI("foo", "foo", STORM_MAX_STR);
REQUIRE(compare == 0);
}
SECTION("compares two strings that match with differing case correctly") {
auto compare = SStrCmpI("foo", "foO", STORM_MAX_STR);
REQUIRE(compare == 0);
}
SECTION("compares two strings that do not match correctly") {
auto compare = SStrCmpI("bar", "xyzzy", STORM_MAX_STR);
REQUIRE(compare < 0);
}
}
TEST_CASE("SStrHashHT", "[string]") {
SECTION("hashes simple string correctly") {
auto hash = SStrHashHT("foo");