From bbc08d3456ce77de1eae63b6f321a9256d54d873 Mon Sep 17 00:00:00 2001 From: Christian Schramm Date: Fri, 28 Mar 2014 09:32:15 +0100 Subject: common: remove gdm_string_hex_{de,en}code() These functions are unused, so there's no reason to keep them around. This commit removes those functions and corresponding test code. https://bugzilla.gnome.org/show_bug.cgi?id=727183 --- tests/Makefile.am | 2 -- tests/m-common.c | 4 +-- tests/s-common-utils.c | 89 -------------------------------------------------- tests/s-common-utils.h | 28 ---------------- 4 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 tests/s-common-utils.c delete mode 100644 tests/s-common-utils.h (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index 88794983..63fc198c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -21,8 +21,6 @@ m_common_SOURCES = \ m-common.c \ s-common-address.c \ s-common-address.h \ - s-common-utils.c \ - s-common-utils.h \ $(NULL) m_common_CFLAGS = \ diff --git a/tests/m-common.c b/tests/m-common.c index 0c038054..c5ff2f4a 100644 --- a/tests/m-common.c +++ b/tests/m-common.c @@ -24,7 +24,6 @@ #include #include "s-common-address.h" -#include "s-common-utils.h" static gboolean no_fork = FALSE; static gboolean verbose = FALSE; @@ -57,8 +56,7 @@ main (int argc, char **argv) exit (1); } - r = srunner_create (suite_common_utils ()); - srunner_add_suite (r, suite_common_address ()); + r = srunner_create (suite_common_address ()); if (no_fork) { srunner_set_fork_status (r, CK_NOFORK); diff --git a/tests/s-common-utils.c b/tests/s-common-utils.c deleted file mode 100644 index b8e284a7..00000000 --- a/tests/s-common-utils.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 Andrew Ziem - * Copyright (C) 2007 William Jon McCann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include -#include -#include - -#include "s-common-utils.h" -#include "gdm-common.h" - -START_TEST (test_gdm_string_hex_encode) -{ - GString *a; - GString *b; - - a = g_string_new ("foo"); - b = g_string_sized_new (100); - fail_unless (TRUE == gdm_string_hex_encode (a, 0, b, 0), NULL); - fail_unless (0 == strncmp (b->str, "666f6f", 7), NULL); - -#ifndef NO_INVALID_INPUT - /* invalid input */ - fail_unless (FALSE == gdm_string_hex_encode (a, -1, b, -1), NULL); - fail_unless (FALSE == gdm_string_hex_encode (NULL, 0, NULL, 0), NULL); - fail_unless (FALSE == gdm_string_hex_encode (a, 0, a, 0), NULL); -#endif - - g_string_free (a, TRUE); - g_string_free (b, TRUE); -} -END_TEST - - -START_TEST (test_gdm_string_hex_decode) - GString *a; - GString *b; - - a = g_string_new ("666f6f"); - b = g_string_sized_new (100); - - fail_unless (TRUE == gdm_string_hex_decode (a, 0, NULL, b, 0), NULL); - - fail_unless (0 == strncmp (b->str, "foo", 7), NULL); - -#ifndef NO_INVALID_INPUT - /* invalid input */ - fail_unless (FALSE == gdm_string_hex_decode (a, -1, NULL, b, -1), NULL); - fail_unless (FALSE == gdm_string_hex_decode (NULL, 0, NULL, NULL, 0), NULL); - fail_unless (FALSE == gdm_string_hex_decode (a, 0, NULL, a, 0), NULL); -#endif - - g_string_free (a, TRUE); - g_string_free (b, TRUE); -END_TEST - -Suite * -suite_common_utils (void) -{ - Suite *s; - TCase *tc_core; - - s = suite_create ("gdm-common"); - tc_core = tcase_create ("core"); - - tcase_add_test (tc_core, test_gdm_string_hex_encode); - tcase_add_test (tc_core, test_gdm_string_hex_decode); - - suite_add_tcase (s, tc_core); - - return s; -} diff --git a/tests/s-common-utils.h b/tests/s-common-utils.h deleted file mode 100644 index dfff893f..00000000 --- a/tests/s-common-utils.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef __S_COMMON_UTILS_H -#define __S_COMMON_UTILS_H - -#include - -Suite *suite_common_utils (void); - -#endif /* __S_COMMON_UTILS_H */ -- cgit v1.2.1