mu: remove some dead code
This commit is contained in:
@ -62,10 +62,6 @@ TEST_PROGS += test-mu-store
|
||||
test_mu_store_SOURCES= test-mu-store.c dummy.cc
|
||||
test_mu_store_LDADD= libtestmucommon.la
|
||||
|
||||
TEST_PROGS += test-mu-date
|
||||
test_mu_date_SOURCES= test-mu-date.c dummy.cc
|
||||
test_mu_date_LDADD= libtestmucommon.la
|
||||
|
||||
TEST_PROGS += test-mu-flags
|
||||
test_mu_flags_SOURCES= test-mu-flags.c dummy.cc
|
||||
test_mu_flags_LDADD= libtestmucommon.la
|
||||
@ -75,14 +71,14 @@ test_mu_container_SOURCES= test-mu-container.c dummy.cc
|
||||
test_mu_container_LDADD= libtestmucommon.la
|
||||
|
||||
# we need to use dummy.cc to enforce c++ linking...
|
||||
BUILT_SOURCES= \
|
||||
BUILT_SOURCES= \
|
||||
dummy.cc
|
||||
|
||||
dummy.cc:
|
||||
touch dummy.cc
|
||||
|
||||
libtestmucommon_la_SOURCES= \
|
||||
test-mu-common.c \
|
||||
libtestmucommon_la_SOURCES= \
|
||||
test-mu-common.c \
|
||||
test-mu-common.h
|
||||
libtestmucommon_la_LIBADD= ../libmu.la
|
||||
|
||||
@ -93,72 +89,72 @@ libtestmucommon_la_LIBADD= ../libmu.la
|
||||
|
||||
# test messages, the '.ignore' message should be ignored
|
||||
# when indexing
|
||||
EXTRA_DIST= \
|
||||
testdir/tmp/1220863087.12663.ignore \
|
||||
testdir/new/1220863087.12663_9.mindcrime \
|
||||
testdir/new/1220863087.12663_25.mindcrime \
|
||||
testdir/new/1220863087.12663_21.mindcrime \
|
||||
testdir/new/1220863087.12663_23.mindcrime \
|
||||
testdir/cur/1220863087.12663_5.mindcrime!2,S \
|
||||
testdir/cur/1220863087.12663_7.mindcrime!2,RS \
|
||||
testdir/cur/1220863087.12663_15.mindcrime!2,PS \
|
||||
testdir/cur/1220863087.12663_19.mindcrime!2,S \
|
||||
testdir/cur/1220863042.12663_1.mindcrime!2,S \
|
||||
testdir/cur/1220863060.12663_3.mindcrime!2,S \
|
||||
testdir/cur/1283599333.1840_11.cthulhu!2, \
|
||||
testdir/cur/1305664394.2171_402.cthulhu!2, \
|
||||
testdir/cur/1252168370_3.14675.cthulhu!2,S \
|
||||
testdir/cur/encrypted!2,S \
|
||||
testdir/cur/multimime!2,FS \
|
||||
testdir/cur/signed!2,S \
|
||||
testdir/cur/signed-encrypted!2,S \
|
||||
testdir/cur/special!2,Sabc \
|
||||
testdir/cur/multirecip!2,S \
|
||||
testdir2/bar/cur/mail1 \
|
||||
testdir2/bar/cur/mail2 \
|
||||
testdir2/bar/cur/mail3 \
|
||||
testdir2/bar/cur/mail4 \
|
||||
testdir2/bar/cur/mail5 \
|
||||
testdir2/bar/cur/181736.eml \
|
||||
testdir2/bar/cur/mail6 \
|
||||
testdir2/bar/tmp/.noindex \
|
||||
testdir2/bar/new/.noindex \
|
||||
testdir2/Foo/cur/mail5 \
|
||||
testdir2/Foo/cur/arto.eml \
|
||||
testdir2/Foo/cur/fraiche.eml \
|
||||
testdir2/Foo/tmp/.noindex \
|
||||
testdir2/Foo/new/.noindex \
|
||||
testdir2/wom_bat/cur/atomic \
|
||||
testdir2/wom_bat/cur/rfc822.1 \
|
||||
testdir2/wom_bat/cur/rfc822.2 \
|
||||
testdir3/cycle \
|
||||
testdir3/cycle/new/.noindex \
|
||||
testdir3/cycle/cur/rogue0 \
|
||||
testdir3/cycle/cur/cycle0 \
|
||||
testdir3/cycle/cur/cycle0.0 \
|
||||
testdir3/cycle/cur/cycle0.0.0 \
|
||||
testdir3/cycle/tmp/.noindex \
|
||||
testdir3/tree/new/.noindex \
|
||||
testdir3/tree/cur/child0.0 \
|
||||
testdir3/tree/cur/child4.0 \
|
||||
testdir3/tree/cur/root2 \
|
||||
testdir3/tree/cur/root1 \
|
||||
testdir3/tree/cur/child3.0.0.0.0 \
|
||||
testdir3/tree/cur/root0 \
|
||||
testdir3/tree/cur/child2.0.0 \
|
||||
testdir3/tree/cur/child0.1 \
|
||||
testdir3/tree/cur/child0.1.0 \
|
||||
testdir3/tree/cur/child4.1 \
|
||||
testdir3/tree/tmp/.noindex \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/A \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/B \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/C \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/D \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/A \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/B \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/C \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/D \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/E \
|
||||
EXTRA_DIST= \
|
||||
testdir/tmp/1220863087.12663.ignore \
|
||||
testdir/new/1220863087.12663_9.mindcrime \
|
||||
testdir/new/1220863087.12663_25.mindcrime \
|
||||
testdir/new/1220863087.12663_21.mindcrime \
|
||||
testdir/new/1220863087.12663_23.mindcrime \
|
||||
testdir/cur/1220863087.12663_5.mindcrime!2,S \
|
||||
testdir/cur/1220863087.12663_7.mindcrime!2,RS \
|
||||
testdir/cur/1220863087.12663_15.mindcrime!2,PS \
|
||||
testdir/cur/1220863087.12663_19.mindcrime!2,S \
|
||||
testdir/cur/1220863042.12663_1.mindcrime!2,S \
|
||||
testdir/cur/1220863060.12663_3.mindcrime!2,S \
|
||||
testdir/cur/1283599333.1840_11.cthulhu!2, \
|
||||
testdir/cur/1305664394.2171_402.cthulhu!2, \
|
||||
testdir/cur/1252168370_3.14675.cthulhu!2,S \
|
||||
testdir/cur/encrypted!2,S \
|
||||
testdir/cur/multimime!2,FS \
|
||||
testdir/cur/signed!2,S \
|
||||
testdir/cur/signed-encrypted!2,S \
|
||||
testdir/cur/special!2,Sabc \
|
||||
testdir/cur/multirecip!2,S \
|
||||
testdir2/bar/cur/mail1 \
|
||||
testdir2/bar/cur/mail2 \
|
||||
testdir2/bar/cur/mail3 \
|
||||
testdir2/bar/cur/mail4 \
|
||||
testdir2/bar/cur/mail5 \
|
||||
testdir2/bar/cur/181736.eml \
|
||||
testdir2/bar/cur/mail6 \
|
||||
testdir2/bar/tmp/.noindex \
|
||||
testdir2/bar/new/.noindex \
|
||||
testdir2/Foo/cur/mail5 \
|
||||
testdir2/Foo/cur/arto.eml \
|
||||
testdir2/Foo/cur/fraiche.eml \
|
||||
testdir2/Foo/tmp/.noindex \
|
||||
testdir2/Foo/new/.noindex \
|
||||
testdir2/wom_bat/cur/atomic \
|
||||
testdir2/wom_bat/cur/rfc822.1 \
|
||||
testdir2/wom_bat/cur/rfc822.2 \
|
||||
testdir3/cycle \
|
||||
testdir3/cycle/new/.noindex \
|
||||
testdir3/cycle/cur/rogue0 \
|
||||
testdir3/cycle/cur/cycle0 \
|
||||
testdir3/cycle/cur/cycle0.0 \
|
||||
testdir3/cycle/cur/cycle0.0.0 \
|
||||
testdir3/cycle/tmp/.noindex \
|
||||
testdir3/tree/new/.noindex \
|
||||
testdir3/tree/cur/child0.0 \
|
||||
testdir3/tree/cur/child4.0 \
|
||||
testdir3/tree/cur/root2 \
|
||||
testdir3/tree/cur/root1 \
|
||||
testdir3/tree/cur/child3.0.0.0.0 \
|
||||
testdir3/tree/cur/root0 \
|
||||
testdir3/tree/cur/child2.0.0 \
|
||||
testdir3/tree/cur/child0.1 \
|
||||
testdir3/tree/cur/child0.1.0 \
|
||||
testdir3/tree/cur/child4.1 \
|
||||
testdir3/tree/tmp/.noindex \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/A \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/B \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/C \
|
||||
testdir3/sort/1st-child-promotes-thread/cur/D \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/A \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/B \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/C \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/D \
|
||||
testdir3/sort/2nd-child-promotes-thread/cur/E \
|
||||
testdir3/sort/child-does-not-promote-thread/cur/A \
|
||||
testdir3/sort/child-does-not-promote-thread/cur/X \
|
||||
testdir3/sort/child-does-not-promote-thread/cur/Y \
|
||||
@ -170,22 +166,22 @@ EXTRA_DIST= \
|
||||
testdir3/sort/grandchild-promotes-only-subthread/cur/E \
|
||||
testdir3/sort/grandchild-promotes-only-subthread/cur/F \
|
||||
testdir3/sort/grandchild-promotes-only-subthread/cur/G \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/A \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/B \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/C \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/D \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/E \
|
||||
testdir4/1220863087.12663_19.mindcrime!2,S \
|
||||
testdir4/1220863042.12663_1.mindcrime!2,S \
|
||||
testdir4/1283599333.1840_11.cthulhu!2, \
|
||||
testdir4/1305664394.2171_402.cthulhu!2, \
|
||||
testdir4/1252168370_3.14675.cthulhu!2,S \
|
||||
testdir4/mail1 \
|
||||
testdir4/mail5 \
|
||||
testdir4/181736.eml \
|
||||
testdir4/encrypted!2,S \
|
||||
testdir4/multimime!2,FS \
|
||||
testdir4/signed!2,S \
|
||||
testdir4/signed-bad!2,S \
|
||||
testdir4/signed-encrypted!2,S \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/A \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/B \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/C \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/D \
|
||||
testdir3/sort/grandchild-promotes-thread/cur/E \
|
||||
testdir4/1220863087.12663_19.mindcrime!2,S \
|
||||
testdir4/1220863042.12663_1.mindcrime!2,S \
|
||||
testdir4/1283599333.1840_11.cthulhu!2, \
|
||||
testdir4/1305664394.2171_402.cthulhu!2, \
|
||||
testdir4/1252168370_3.14675.cthulhu!2,S \
|
||||
testdir4/mail1 \
|
||||
testdir4/mail5 \
|
||||
testdir4/181736.eml \
|
||||
testdir4/encrypted!2,S \
|
||||
testdir4/multimime!2,FS \
|
||||
testdir4/signed!2,S \
|
||||
testdir4/signed-bad!2,S \
|
||||
testdir4/signed-encrypted!2,S \
|
||||
testdir4/special!2,Sabc
|
||||
|
||||
@ -34,113 +34,6 @@
|
||||
#include "mu-date.h"
|
||||
|
||||
|
||||
static void
|
||||
test_mu_date_str (void)
|
||||
{
|
||||
struct tm *tmbuf;
|
||||
char buf[64];
|
||||
gchar *tmp;
|
||||
time_t some_time;
|
||||
|
||||
some_time = 1234567890;
|
||||
tmbuf = localtime (&some_time);
|
||||
strftime (buf, 64, "%x", tmbuf);
|
||||
|
||||
/* $ date -ud@1234567890; Fri Feb 13 23:31:30 UTC 2009 */
|
||||
g_assert_cmpstr (mu_date_str_s ("%x", some_time), ==, buf);
|
||||
|
||||
/* date -ud@987654321 Thu Apr 19 04:25:21 UTC 2001 */
|
||||
some_time = 987654321;
|
||||
tmbuf = localtime (&some_time);
|
||||
strftime (buf, 64, "%c", tmbuf);
|
||||
tmp = mu_date_str ("%c", some_time);
|
||||
|
||||
g_assert_cmpstr (tmp, ==, buf);
|
||||
g_free (tmp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
test_mu_date_parse_hdwmy (void)
|
||||
{
|
||||
time_t diff;
|
||||
|
||||
diff = time(NULL) - mu_date_parse_hdwmy ("3h");
|
||||
g_assert (diff > 0);
|
||||
g_assert_cmpuint (3 * 60 * 60 - diff, <=, 1);
|
||||
|
||||
diff = time(NULL) - mu_date_parse_hdwmy ("5y");
|
||||
g_assert (diff > 0);
|
||||
g_assert_cmpuint (5 * 365 * 24 * 60 * 60 - diff, <=, 1);
|
||||
|
||||
diff = time(NULL) - mu_date_parse_hdwmy ("3m");
|
||||
g_assert (diff > 0);
|
||||
g_assert_cmpuint (3 * 30 * 24 * 60 * 60 - diff, <=, 1);
|
||||
|
||||
diff = time(NULL) - mu_date_parse_hdwmy ("21d");
|
||||
g_assert (diff > 0);
|
||||
g_assert_cmpuint (21 * 24 * 60 * 60 - diff, <=, 1);
|
||||
|
||||
diff = time(NULL) - mu_date_parse_hdwmy ("2w");
|
||||
g_assert (diff > 0);
|
||||
g_assert_cmpuint (2 * 7 * 24 * 60 * 60 - diff, <=, 1);
|
||||
|
||||
|
||||
g_assert_cmpint (mu_date_parse_hdwmy("-1y"),==, (time_t)-1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_mu_date_complete_begin (void)
|
||||
{
|
||||
g_assert_cmpstr (mu_date_complete_s("2000", TRUE), ==,
|
||||
"20000101000000");
|
||||
g_assert_cmpstr (mu_date_complete_s("2", TRUE), ==,
|
||||
"20000101000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("", TRUE), ==,
|
||||
"00000101000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("201007", TRUE), ==,
|
||||
"20100701000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("19721214", TRUE), ==,
|
||||
"19721214000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("19721214234512", TRUE), ==,
|
||||
"19721214234512");
|
||||
|
||||
g_assert_cmpstr (mu_date_complete_s ("2010-07", TRUE), ==,
|
||||
"20100701000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("1972/12/14", TRUE), ==,
|
||||
"19721214000000");
|
||||
g_assert_cmpstr (mu_date_complete_s ("1972-12-14 23:45:12", TRUE), ==,
|
||||
"19721214234512");
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_mu_date_complete_end (void)
|
||||
{
|
||||
g_assert_cmpstr (mu_date_complete_s ("2000", FALSE), ==,
|
||||
"20001231235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("2", FALSE), ==,
|
||||
"29991231235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("", FALSE), ==,
|
||||
"99991231235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("201007", FALSE), ==,
|
||||
"20100731235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("19721214", FALSE), ==,
|
||||
"19721214235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("19721214234512", FALSE), ==,
|
||||
"19721214234512");
|
||||
|
||||
g_assert_cmpstr (mu_date_complete_s ("2010-07", FALSE), ==,
|
||||
"20100731235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("1972.12.14", FALSE), ==,
|
||||
"19721214235959");
|
||||
g_assert_cmpstr (mu_date_complete_s ("1972.12.14 23:45/12", FALSE), ==,
|
||||
"19721214234512");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -179,10 +72,6 @@ main (int argc, char *argv[])
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* mu_str_date */
|
||||
g_test_add_func ("/mu-str/mu-date-str",
|
||||
test_mu_date_str);
|
||||
|
||||
g_test_add_func ("/mu-str/mu_date_parse_hdwmy",
|
||||
test_mu_date_parse_hdwmy);
|
||||
g_test_add_func ("/mu-str/mu_date_complete_begin",
|
||||
|
||||
@ -56,7 +56,7 @@ test_mu_util_dir_expand_01 (void)
|
||||
* work. Turn of the test for now */
|
||||
return;
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_WORDEXP_H
|
||||
{
|
||||
gchar *got, *expected;
|
||||
@ -162,37 +162,6 @@ test_mu_util_check_dir_04 (void)
|
||||
FALSE);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_mu_util_str_from_strv_01 (void)
|
||||
{
|
||||
const gchar *strv[] = { "aap", "noot", "mies", NULL };
|
||||
gchar *str = mu_util_str_from_strv (strv);
|
||||
g_assert_cmpstr (str, ==, "aap noot mies");
|
||||
g_free (str);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
test_mu_util_str_from_strv_02 (void)
|
||||
{
|
||||
const gchar *strv[] = { "test", NULL };
|
||||
gchar *str = mu_util_str_from_strv (strv);
|
||||
g_assert_cmpstr (str, ==, "test");
|
||||
g_free (str);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
test_mu_util_str_from_strv_03 (void)
|
||||
{
|
||||
const gchar *strv[] = { NULL };
|
||||
gchar *str = mu_util_str_from_strv (strv);
|
||||
g_assert_cmpstr (str, ==, "");
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
test_mu_util_get_dtype_with_lstat (void)
|
||||
{
|
||||
@ -223,10 +192,12 @@ test_mu_util_supports (void)
|
||||
path = g_find_program_in_path ("gnuplot");
|
||||
g_free (path);
|
||||
|
||||
g_assert_cmpuint (mu_util_supports (MU_FEATURE_GNUPLOT),==,path ? TRUE : FALSE);
|
||||
g_assert_cmpuint (mu_util_supports (MU_FEATURE_GNUPLOT),==,
|
||||
path ? TRUE : FALSE);
|
||||
|
||||
g_assert_cmpuint (
|
||||
mu_util_supports (MU_FEATURE_GNUPLOT|MU_FEATURE_GUILE|MU_FEATURE_CRYPTO),
|
||||
mu_util_supports (MU_FEATURE_GNUPLOT|MU_FEATURE_GUILE|
|
||||
MU_FEATURE_CRYPTO),
|
||||
==,
|
||||
has_guile && path ? TRUE : FALSE);
|
||||
}
|
||||
@ -246,8 +217,10 @@ main (int argc, char *argv[])
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
/* mu_util_dir_expand */
|
||||
g_test_add_func ("/mu-util/mu-util-dir-expand-00", test_mu_util_dir_expand_00);
|
||||
g_test_add_func ("/mu-util/mu-util-dir-expand-01", test_mu_util_dir_expand_01);
|
||||
g_test_add_func ("/mu-util/mu-util-dir-expand-00",
|
||||
test_mu_util_dir_expand_00);
|
||||
g_test_add_func ("/mu-util/mu-util-dir-expand-01",
|
||||
test_mu_util_dir_expand_01);
|
||||
|
||||
/* mu_util_guess_maildir */
|
||||
g_test_add_func ("/mu-util/mu-util-guess-maildir-01",
|
||||
@ -256,24 +229,21 @@ main (int argc, char *argv[])
|
||||
test_mu_util_guess_maildir_02);
|
||||
|
||||
/* mu_util_check_dir */
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-01", test_mu_util_check_dir_01);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-02", test_mu_util_check_dir_02);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-03", test_mu_util_check_dir_03);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-04", test_mu_util_check_dir_04);
|
||||
|
||||
/* test_mu_util_str_from_strv */
|
||||
g_test_add_func ("/mu-util/mu-util-str-from-strv-01",
|
||||
test_mu_util_str_from_strv_01);
|
||||
g_test_add_func ("/mu-util/mu-util-str-from-strv-02",
|
||||
test_mu_util_str_from_strv_02);
|
||||
g_test_add_func ("/mu-util/mu-util-str-from-strv-03",
|
||||
test_mu_util_str_from_strv_03);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-01",
|
||||
test_mu_util_check_dir_01);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-02",
|
||||
test_mu_util_check_dir_02);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-03",
|
||||
test_mu_util_check_dir_03);
|
||||
g_test_add_func ("/mu-util/mu-util-check-dir-04",
|
||||
test_mu_util_check_dir_04);
|
||||
|
||||
g_test_add_func ("/mu-util/mu-util-get-dtype-with-lstat",
|
||||
test_mu_util_get_dtype_with_lstat);
|
||||
|
||||
g_test_add_func ("/mu-util/mu-util-supports", test_mu_util_supports);
|
||||
g_test_add_func ("/mu-util/mu-util-program-in-path", test_mu_util_program_in_path);
|
||||
g_test_add_func ("/mu-util/mu-util-program-in-path",
|
||||
test_mu_util_program_in_path);
|
||||
|
||||
|
||||
g_log_set_handler (NULL,
|
||||
|
||||
Reference in New Issue
Block a user