From: Matthias Clasen Date: Thu, 6 Oct 2011 03:24:27 +0000 (-0400) Subject: Improve coverage of string function tests X-Git-Tag: 2.31.0~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eeedaac3e8306403c9359edd8e4baea6a22153ed;p=platform%2Fupstream%2Fglib.git Improve coverage of string function tests --- diff --git a/glib/tests/strfuncs.c b/glib/tests/strfuncs.c index 14e7fd4..38aa16a 100644 --- a/glib/tests/strfuncs.c +++ b/glib/tests/strfuncs.c @@ -1241,6 +1241,34 @@ test_strip_context (void) g_assert (s == msgval + 7); } +static void +test_strerror (void) +{ + gint i; + const gchar *str; + + for (i = 1; i < 100; i++) + { + str = g_strerror (i); + g_assert (str != NULL); + g_assert (g_utf8_validate (str, -1, NULL)); + } +} + +static void +test_strsignal (void) +{ + gint i; + const gchar *str; + + for (i = 1; i < 20; i++) + { + str = g_strsignal (i); + g_assert (str != NULL); + g_assert (g_utf8_validate (str, -1, NULL)); + } +} + int main (int argc, char *argv[]) @@ -1271,6 +1299,8 @@ main (int argc, g_test_add_func ("/strfuncs/strtoull-strtoll", test_strtoll); g_test_add_func ("/strfuncs/bounds-check", test_bounds); g_test_add_func ("/strfuncs/strip-context", test_strip_context); + g_test_add_func ("/strfuncs/strerror", test_strerror); + g_test_add_func ("/strfuncs/strsignal", test_strsignal); return g_test_run(); }