summaryrefslogtreecommitdiff
path: root/tests/unit/core/test-core-utf8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/core/test-core-utf8.cpp')
-rw-r--r--tests/unit/core/test-core-utf8.cpp48
1 files changed, 26 insertions, 22 deletions
diff --git a/tests/unit/core/test-core-utf8.cpp b/tests/unit/core/test-core-utf8.cpp
index 7da5482b1..cd330eadf 100644
--- a/tests/unit/core/test-core-utf8.cpp
+++ b/tests/unit/core/test-core-utf8.cpp
@@ -602,43 +602,47 @@ TEST(CoreUtf8, Comparison)
{
/* case-sensitive comparison */
LONGS_EQUAL(0, utf8_charcmp (NULL, NULL));
- LONGS_EQUAL(-1, utf8_charcmp (NULL, "abc"));
- LONGS_EQUAL(1, utf8_charcmp ("abc", NULL));
+ LONGS_EQUAL(-97, utf8_charcmp (NULL, "abc"));
+ LONGS_EQUAL(97, utf8_charcmp ("abc", NULL));
LONGS_EQUAL(0, utf8_charcmp ("axx", "azz"));
- LONGS_EQUAL(-1, utf8_charcmp ("A", "Z"));
- LONGS_EQUAL(1, utf8_charcmp ("Z", "A"));
- LONGS_EQUAL(-1, utf8_charcmp ("A", "a"));
- LONGS_EQUAL(-1, utf8_charcmp ("ë", "€"));
- LONGS_EQUAL(1, utf8_charcmp ("ë", ""));
- LONGS_EQUAL(-1, utf8_charcmp ("", "ë"));
+ LONGS_EQUAL(-2, utf8_charcmp ("A", "C"));
+ LONGS_EQUAL(2, utf8_charcmp ("C", "A"));
+ LONGS_EQUAL(-32, utf8_charcmp ("A", "a"));
+ LONGS_EQUAL(-8129, utf8_charcmp ("ë", "€"));
+ LONGS_EQUAL(235, utf8_charcmp ("ë", ""));
+ LONGS_EQUAL(-235, utf8_charcmp ("", "ë"));
/* case-insensitive comparison */
LONGS_EQUAL(0, utf8_charcasecmp (NULL, NULL));
- LONGS_EQUAL(-1, utf8_charcasecmp (NULL, "abc"));
- LONGS_EQUAL(1, utf8_charcasecmp ("abc", NULL));
+ LONGS_EQUAL(-97, utf8_charcasecmp (NULL, "abc"));
+ LONGS_EQUAL(97, utf8_charcasecmp ("abc", NULL));
LONGS_EQUAL(0, utf8_charcasecmp ("axx", "azz"));
- LONGS_EQUAL(-1, utf8_charcasecmp ("A", "Z"));
- LONGS_EQUAL(1, utf8_charcasecmp ("Z", "A"));
+ LONGS_EQUAL(-2, utf8_charcasecmp ("A", "C"));
+ LONGS_EQUAL(2, utf8_charcasecmp ("C", "A"));
LONGS_EQUAL(0, utf8_charcasecmp ("A", "a"));
- LONGS_EQUAL(-1, utf8_charcasecmp ("ë", "€"));
+ LONGS_EQUAL(-8129, utf8_charcasecmp ("ë", "€"));
/* case-insensitive comparison with a range */
LONGS_EQUAL(0, utf8_charcasecmp_range (NULL, NULL, 30));
- LONGS_EQUAL(-1, utf8_charcasecmp_range (NULL, "abc", 30));
- LONGS_EQUAL(1, utf8_charcasecmp_range ("abc", NULL, 30));
+ LONGS_EQUAL(-97, utf8_charcasecmp_range (NULL, "abc", 30));
+ LONGS_EQUAL(97, utf8_charcasecmp_range ("abc", NULL, 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("axx", "azz", 30));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("A", "Z", 30));
- LONGS_EQUAL(1, utf8_charcasecmp_range ("Z", "A", 30));
+ LONGS_EQUAL(-2, utf8_charcasecmp_range ("A", "C", 30));
+ LONGS_EQUAL(2, utf8_charcasecmp_range ("C", "A", 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("A", "a", 30));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("ë", "€", 30));
+ LONGS_EQUAL(-8129, utf8_charcasecmp_range ("ë", "€", 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("[", "{", 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("]", "}", 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("\\", "|", 30));
LONGS_EQUAL(0, utf8_charcasecmp_range ("^", "~", 30));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("[", "{", 26));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("]", "}", 26));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("\\", "|", 26));
- LONGS_EQUAL(-1, utf8_charcasecmp_range ("^", "~", 26));
+ LONGS_EQUAL(-32, utf8_charcasecmp_range ("[", "{", 26));
+ LONGS_EQUAL(32, utf8_charcasecmp_range ("{", "[", 26));
+ LONGS_EQUAL(-32, utf8_charcasecmp_range ("]", "}", 26));
+ LONGS_EQUAL(32, utf8_charcasecmp_range ("}", "]", 26));
+ LONGS_EQUAL(-32, utf8_charcasecmp_range ("\\", "|", 26));
+ LONGS_EQUAL(32, utf8_charcasecmp_range ("|", "\\", 26));
+ LONGS_EQUAL(-32, utf8_charcasecmp_range ("^", "~", 26));
+ LONGS_EQUAL(32, utf8_charcasecmp_range ("~", "^", 26));
}
/*