Fix tests

This commit is contained in:
12pm 2019-02-10 19:13:55 +01:00
parent ed55ac6d81
commit 74992d9bd7
2 changed files with 5 additions and 2 deletions

View file

@ -2739,6 +2739,9 @@ int str_utf8_comp_nocase(const char *a, const char *b)
int str_utf8_comp_nocase_num(const char *a, const char *b, int num)
{
if(num <= 0)
return 0;
int code_a;
int code_b;
const char *old_a = a;

View file

@ -72,8 +72,8 @@ TEST(Str, Utf8ToLower)
EXPECT_TRUE(str_utf8_comp_nocase(a, b) > 0);
EXPECT_TRUE(str_utf8_comp_nocase(b, a) < 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 3) == 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 4) != 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 5) == 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 6) != 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("a", "z", 0) == 0);
EXPECT_TRUE(str_utf8_comp_nocase_num("a", "z", 1) != 0);