summaryrefslogtreecommitdiff
path: root/shared/nm-glib-aux/tests/test-shared-general.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared/nm-glib-aux/tests/test-shared-general.c')
-rw-r--r--shared/nm-glib-aux/tests/test-shared-general.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/shared/nm-glib-aux/tests/test-shared-general.c b/shared/nm-glib-aux/tests/test-shared-general.c
index 37d6618ad8..afccb969f0 100644
--- a/shared/nm-glib-aux/tests/test-shared-general.c
+++ b/shared/nm-glib-aux/tests/test-shared-general.c
@@ -891,6 +891,25 @@ again:
/*****************************************************************************/
+static void
+test_in_strset_ascii_case (void)
+{
+ const char *x;
+
+ x = NULL;
+ g_assert (NM_IN_STRSET_ASCII_CASE (x, NULL));
+ g_assert (NM_IN_STRSET_ASCII_CASE (x, NULL, "b"));
+ g_assert (!NM_IN_STRSET_ASCII_CASE (x, "b"));
+
+ x = "b";
+ g_assert (NM_IN_STRSET (x, "b"));
+ g_assert (NM_IN_STRSET_ASCII_CASE (x, "b"));
+ g_assert (!NM_IN_STRSET (x, "B"));
+ g_assert (NM_IN_STRSET_ASCII_CASE (x, "B"));
+}
+
+/*****************************************************************************/
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -913,6 +932,7 @@ int main (int argc, char **argv)
g_test_add_func ("/general/test_nm_utils_get_next_realloc_size", test_nm_utils_get_next_realloc_size);
g_test_add_func ("/general/test_nm_str_buf", test_nm_str_buf);
g_test_add_func ("/general/test_nm_utils_parse_next_line", test_nm_utils_parse_next_line);
+ g_test_add_func ("/general/test_in_strset_ascii_case", test_in_strset_ascii_case);
return g_test_run ();
}