mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #1561
1561: Fix negative numbers in char r=def- a=yangfl On some architectures char can be unsigned, which makes g++ very unhappy. error: narrowing conversion of '-128' from 'int' to 'char' inside { } Co-authored-by: yangfl <yangfl@users.noreply.github.com>
This commit is contained in:
commit
4f168ba936
|
@ -67,10 +67,12 @@ TEST(Str, Utf8ToLower)
|
|||
EXPECT_TRUE(str_utf8_comp_nocase("ÖlÜ", "ölüa") < 0); // NULL < a
|
||||
EXPECT_TRUE(str_utf8_comp_nocase("ölüa", "ÖlÜ") > 0); // a < NULL
|
||||
|
||||
const char a[2] = {-128, 0};
|
||||
#if (CHAR_MIN < 0)
|
||||
const char a[2] = {CHAR_MIN, 0};
|
||||
const char b[2] = {0, 0};
|
||||
EXPECT_TRUE(str_utf8_comp_nocase(a, b) > 0);
|
||||
EXPECT_TRUE(str_utf8_comp_nocase(b, a) < 0);
|
||||
#endif
|
||||
|
||||
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 5) == 0);
|
||||
EXPECT_TRUE(str_utf8_comp_nocase_num("ÖlÜ", "ölüa", 6) != 0);
|
||||
|
|
Loading…
Reference in a new issue