talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 94019c056e89cdb1b2aeb6b8e1f502e6e95b6211
parent 7c3fb6c33bd97c21668222c9dae10ef9b956888c
Author: Paul <paul@claws-mail.org>
Date:   Sat, 23 Jul 2022 14:52:51 +0100

fix bug 4547, '--enable-tests makes compilation fail'

remove broken test

Diffstat:
Mconfigure.ac | 1-
Msrc/plugins/pgpcore/Makefile.am | 5-----
Dsrc/plugins/pgpcore/tests/Makefile.am | 19-------------------
Dsrc/plugins/pgpcore/tests/pgp_utils_test.c | 87-------------------------------------------------------------------------------
4 files changed, 0 insertions(+), 112 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -2178,7 +2178,6 @@ src/plugins/python/Makefile src/plugins/python/examples/Makefile src/plugins/pgpcore/Makefile src/plugins/pgpcore/version.rc -src/plugins/pgpcore/tests/Makefile src/plugins/pgpmime/Makefile src/plugins/pgpmime/version.rc src/plugins/pgpinline/Makefile diff --git a/src/plugins/pgpcore/Makefile.am b/src/plugins/pgpcore/Makefile.am @@ -5,11 +5,6 @@ include $(srcdir)/../win_plugin.mk -if BUILD_TESTS -include $(top_srcdir)/tests.mk -SUBDIRS = . tests -endif - IFLAGS = \ -I$(top_builddir)/src \ -I$(top_builddir)/src/common \ diff --git a/src/plugins/pgpcore/tests/Makefile.am b/src/plugins/pgpcore/tests/Makefile.am @@ -1,19 +0,0 @@ -include $(top_srcdir)/tests.mk - -common_ldadd = \ - $(GLIB_LIBS) - -AM_CPPFLAGS = \ - $(GLIB_CFLAGS) \ - $(GTK_CFLAGS) \ - -I.. \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/common - -TEST_PROGS += pgp_utils_test -pgp_utils_test_SOURCES = pgp_utils_test.c -pgp_utils_test_LDADD = $(common_ldadd) ../pgpcore_la-pgp_utils.o - -noinst_PROGRAMS = $(TEST_PROGS) - -.PHONY: test diff --git a/src/plugins/pgpcore/tests/pgp_utils_test.c b/src/plugins/pgpcore/tests/pgp_utils_test.c @@ -1,87 +0,0 @@ -#include "config.h" - -#include "pgp_utils.h" - -#define HEADER "HEADER" -struct td { - gchar *input; - gchar *expected_output; -}; - -static void -test_pgp_locate_armor_header_null() -{ - if (!g_test_undefined()) - return; - - if (g_test_subprocess()) { - gchar *out = pgp_locate_armor_header(NULL, HEADER); - g_assert_null(out); - return; - } - - g_test_trap_subprocess(NULL, 0, 0); - g_test_trap_assert_stderr("*assertion*failed*"); - g_test_trap_assert_failed(); -} - -static void -test_pgp_locate_armor_header(gconstpointer user_data) -{ - struct td *data = (struct td *)user_data; - gchar *out = pgp_locate_armor_header(data->input, HEADER); - - g_assert_cmpstr(out, ==, data->expected_output); -} - -struct td td_justheader = { - "HEADER", - "HEADER" -}; - -struct td td_leading = { - "leadingHEADER", - NULL -}; - -struct td td_trailingspaces = { - "HEADER ", - "HEADER " -}; - -struct td td_trailingtext1 = { - "HEADERblah", - NULL -}; - -struct td td_trailingtext2 = { - "HEADER blah", - NULL -}; - -struct td td_leadinglines = { - "foo\nHEADER\nbar", - "HEADER\nbar" -}; - -#define TEST(name, data) \ - g_test_add_data_func("/plugins/pgpcore/pgp_locate_armor_header_"name, \ - &data, \ - test_pgp_locate_armor_header) -int -main (int argc, char *argv[]) -{ - g_test_init(&argc, &argv, NULL); - - g_test_add_func("/plugins/pgpcore/pgp_locate_armor_header_null", - test_pgp_locate_armor_header_null); - - TEST("justheader", td_justheader); - TEST("leading", td_leading); - TEST("trailingspaces", td_trailingspaces); - TEST("trailingtext1", td_trailingtext1); - TEST("trailingtext2", td_trailingtext2); - TEST("leadinglines", td_leadinglines); - - return g_test_run(); -}