summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-12-18 14:10:10 +0100
committerSébastien Helleu <flashcode@flashtux.org>2022-12-18 14:28:58 +0100
commit40339b288ac37ace539d9091e8a2878540f49273 (patch)
tree5570b3a5a48e8a4cee4daaa36bc002d93a392084 /tests
parenteb6cc0bc2afa96824667521d3405bd1c077a4690 (diff)
downloadweechat-40339b288ac37ace539d9091e8a2878540f49273.zip
api: return newly allocated string in functions string_tolower and string_toupper
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/test-core-string.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp
index 525026799..ec8dce52c 100644
--- a/tests/unit/core/test-core-string.cpp
+++ b/tests/unit/core/test-core-string.cpp
@@ -188,13 +188,13 @@ TEST(CoreString, ToLower)
{
char *str;
- str = strdup ("ABC");
+ WEE_TEST_STR(NULL, string_tolower (NULL));
- string_tolower (NULL);
- string_tolower (str);
- STRCMP_EQUAL("abc", str);
-
- free (str);
+ WEE_TEST_STR("", string_tolower (""));
+ WEE_TEST_STR("abcd_É", string_tolower ("ABCD_É"));
+ WEE_TEST_STR("À É Ï Ô Ü Ÿ Æ Œ Ç", string_tolower ("À É Ï Ô Ü Ÿ Æ Œ Ç"));
+ WEE_TEST_STR("€", string_tolower ("€"));
+ WEE_TEST_STR("[⛄]", string_tolower ("[⛄]"));
}
/*
@@ -202,17 +202,17 @@ TEST(CoreString, ToLower)
* string_toupper
*/
-TEST(CoreString, Case)
+TEST(CoreString, ToUpper)
{
char *str;
- str = strdup ("abc");
-
- string_toupper (NULL);
- string_toupper (str);
- STRCMP_EQUAL("ABC", str);
+ WEE_TEST_STR(NULL, string_tolower (NULL));
- free (str);
+ WEE_TEST_STR("", string_toupper (""));
+ WEE_TEST_STR("ABCD_é", string_toupper ("abcd_é"));
+ WEE_TEST_STR("à é ï ô ü ÿ æ œ ç", string_toupper ("à é ï ô ü ÿ æ œ ç"));
+ WEE_TEST_STR("€", string_toupper ("€"));
+ WEE_TEST_STR("[⛄]", string_toupper ("[⛄]"));
}
/*