From 2c338e21d6f86bad96283d5388991dc4c4b34361 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 18 Aug 2012 14:41:35 -0400 Subject: [PATCH] Improve strfuncs tests coverage --- glib/tests/strfuncs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c index 9b2d1d652..8e376f740 100644 --- a/glib/tests/strfuncs.c +++ b/glib/tests/strfuncs.c @@ -567,6 +567,13 @@ test_strreverse (void) g_free (str); } +static void +test_strncasecmp (void) +{ + g_assert (g_strncasecmp ("abc1", "ABC2", 3) == 0); + g_assert (g_strncasecmp ("abc1", "ABC2", 4) != 0); +} + static void test_strstr (void) { @@ -1340,6 +1347,7 @@ main (int argc, g_test_add_func ("/strfuncs/strchug", test_strchug); g_test_add_func ("/strfuncs/strchomp", test_strchomp); g_test_add_func ("/strfuncs/strreverse", test_strreverse); + g_test_add_func ("/strfuncs/strncasecmp", test_strncasecmp); g_test_add_func ("/strfuncs/strstr", test_strstr); g_test_add_func ("/strfuncs/has-prefix", test_has_prefix); g_test_add_func ("/strfuncs/has-suffix", test_has_suffix);