From 305608ce895ab4ba697359c0fba3883d8a630d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 14 Jan 2022 21:43:06 +0100 Subject: [PATCH] tests: split tests on functions string_tolower and string_toupper --- tests/unit/core/test-core-string.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/unit/core/test-core-string.cpp b/tests/unit/core/test-core-string.cpp index b6072489a..e2b4be36a 100644 --- a/tests/unit/core/test-core-string.cpp +++ b/tests/unit/core/test-core-string.cpp @@ -157,6 +157,23 @@ TEST(CoreString, Strndup) /* * Tests functions: * string_tolower + */ + +TEST(CoreString, ToLower) +{ + char *str; + + str = strdup ("ABC"); + + string_tolower (NULL); + string_tolower (str); + STRCMP_EQUAL("abc", str); + + free (str); +} + +/* + * Tests functions: * string_toupper */ @@ -164,10 +181,9 @@ TEST(CoreString, Case) { char *str; - str = strdup ("ABC"); + str = strdup ("abc"); - string_tolower (str); - STRCMP_EQUAL("abc", str); + string_toupper (NULL); string_toupper (str); STRCMP_EQUAL("ABC", str);