From 8a1e2b328572df8adb341837473918ce3af6d60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 19 Jan 2017 12:07:14 -0800 Subject: [PATCH] strincmp: More unit tests. --- tests/string_test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 1600830..20e3c39 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -59,6 +59,18 @@ TEST_CASE("strincmp", "") REQUIRE(0 == bx::strincmp("test", "testestes", 4) ); REQUIRE(0 == bx::strincmp("testestes", "test", 4) ); REQUIRE(0 != bx::strincmp("preprocess", "platform") ); + + const char* abvgd = "abvgd"; + const char* abvgx = "abvgx"; + const char* empty = ""; + REQUIRE(0 == bx::strincmp(abvgd, abvgd) ); + REQUIRE(0 == bx::strincmp(abvgd, abvgx, 4) ); + + REQUIRE(0 > bx::strincmp(abvgd, abvgx) ); + REQUIRE(0 > bx::strincmp(empty, abvgd) ); + + REQUIRE(0 < bx::strincmp(abvgx, abvgd) ); + REQUIRE(0 < bx::strincmp(abvgd, empty) ); } TEST_CASE("strnchr", "")