mirror of https://github.com/djcb/mu.git
contacts: remove some dead code
This commit is contained in:
parent
fb34824232
commit
af386824f2
|
@ -127,3 +127,16 @@ compile_commands.json
|
||||||
/lib/test-mu-tokenizer
|
/lib/test-mu-tokenizer
|
||||||
/lib/test-mu-parser
|
/lib/test-mu-parser
|
||||||
/lib/test-mu-query-threader
|
/lib/test-mu-query-threader
|
||||||
|
/lib/test-contacts
|
||||||
|
/lib/test-flags
|
||||||
|
/lib/test-maildir
|
||||||
|
/lib/test-msg
|
||||||
|
/lib/test-msg-fields
|
||||||
|
/lib/test-query
|
||||||
|
/lib/test-store
|
||||||
|
/lib/test-threader
|
||||||
|
/mu/test-cmd
|
||||||
|
/mu/test-cmd-cfind
|
||||||
|
/mu/test-query
|
||||||
|
/mu/test-threads
|
||||||
|
/lib/test-threads
|
||||||
|
|
474
lib/Makefile.am
474
lib/Makefile.am
|
@ -20,170 +20,176 @@ include $(top_srcdir)/gtest.mk
|
||||||
|
|
||||||
SUBDIRS= utils index
|
SUBDIRS= utils index
|
||||||
|
|
||||||
TESTDEFS= \
|
TESTDEFS= \
|
||||||
-DMU_TESTMAILDIR=\"${abs_srcdir}/testdir\" \
|
-DMU_TESTMAILDIR=\"${abs_srcdir}/testdir\" \
|
||||||
-DMU_TESTMAILDIR2=\"${abs_srcdir}/testdir2\" \
|
-DMU_TESTMAILDIR2=\"${abs_srcdir}/testdir2\" \
|
||||||
-DMU_TESTMAILDIR3=\"${abs_srcdir}/testdir3\" \
|
-DMU_TESTMAILDIR3=\"${abs_srcdir}/testdir3\" \
|
||||||
-DMU_TESTMAILDIR4=\"${abs_srcdir}/testdir4\" \
|
-DMU_TESTMAILDIR4=\"${abs_srcdir}/testdir4\" \
|
||||||
-DABS_CURDIR=\"${abs_builddir}\" \
|
-DABS_CURDIR=\"${abs_builddir}\" \
|
||||||
-DABS_SRCDIR=\"${abs_srcdir}\"
|
-DABS_SRCDIR=\"${abs_srcdir}\"
|
||||||
|
|
||||||
|
|
||||||
AM_CFLAGS= \
|
AM_CFLAGS= \
|
||||||
$(WARN_CFLAGS) \
|
$(WARN_CFLAGS) \
|
||||||
$(GMIME_CFLAGS) \
|
$(GMIME_CFLAGS) \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(GUILE_CFLAGS) \
|
$(GUILE_CFLAGS) \
|
||||||
$(ASAN_CFLAGS) \
|
$(ASAN_CFLAGS) \
|
||||||
$(CODE_COVERAGE_CFLAGS) \
|
$(CODE_COVERAGE_CFLAGS) \
|
||||||
$(TESTDEFS) \
|
$(TESTDEFS) \
|
||||||
-Wno-format-nonliteral \
|
-Wno-format-nonliteral \
|
||||||
-Wno-switch-enum \
|
-Wno-switch-enum \
|
||||||
-Wno-deprecated-declarations \
|
-Wno-deprecated-declarations \
|
||||||
-Wno-inline
|
-Wno-inline
|
||||||
|
|
||||||
AM_CXXFLAGS= \
|
AM_CXXFLAGS= \
|
||||||
$(GMIME_CFLAGS) \
|
$(GMIME_CFLAGS) \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(GUILE_CFLAGS) \
|
$(GUILE_CFLAGS) \
|
||||||
$(WARN_CXXFLAGS) \
|
$(WARN_CXXFLAGS) \
|
||||||
$(XAPIAN_CXXFLAGS) \
|
$(XAPIAN_CXXFLAGS) \
|
||||||
$(ASAN_CXXFLAGS) \
|
$(ASAN_CXXFLAGS) \
|
||||||
$(CODE_COVERAGE_CFLAGS) \
|
$(CODE_COVERAGE_CFLAGS) \
|
||||||
$(TESTDEFS)
|
$(TESTDEFS)
|
||||||
|
|
||||||
AM_CPPFLAGS= \
|
AM_CPPFLAGS= \
|
||||||
$(CODE_COVERAGE_CPPFLAGS)
|
$(CODE_COVERAGE_CPPFLAGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES= \
|
noinst_LTLIBRARIES= \
|
||||||
libmu.la
|
libmu.la
|
||||||
|
|
||||||
libmu_la_SOURCES= \
|
libmu_la_SOURCES= \
|
||||||
mu-bookmarks.cc \
|
mu-bookmarks.cc \
|
||||||
mu-bookmarks.hh \
|
mu-bookmarks.hh \
|
||||||
mu-contacts.cc \
|
mu-contacts.cc \
|
||||||
mu-contacts.hh \
|
mu-contacts.hh \
|
||||||
mu-data.hh \
|
mu-data.hh \
|
||||||
mu-parser.cc \
|
mu-parser.cc \
|
||||||
mu-parser.hh \
|
mu-parser.hh \
|
||||||
mu-query.cc \
|
mu-query.cc \
|
||||||
mu-query.hh \
|
mu-query.hh \
|
||||||
mu-query-results.hh \
|
mu-query-results.hh \
|
||||||
mu-query-match-deciders.cc \
|
mu-query-match-deciders.cc \
|
||||||
mu-query-match-deciders.hh \
|
mu-query-match-deciders.hh \
|
||||||
mu-query-threader.cc \
|
mu-query-threads.cc \
|
||||||
mu-query-threader.hh \
|
mu-query-threads.hh \
|
||||||
mu-runtime.cc \
|
mu-runtime.cc \
|
||||||
mu-runtime.hh \
|
mu-runtime.hh \
|
||||||
mu-script.cc \
|
mu-script.cc \
|
||||||
mu-script.hh \
|
mu-script.hh \
|
||||||
mu-server.cc \
|
mu-server.cc \
|
||||||
mu-server.hh \
|
mu-server.hh \
|
||||||
mu-store.cc \
|
mu-store.cc \
|
||||||
mu-store.hh \
|
mu-store.hh \
|
||||||
mu-tokenizer.cc \
|
mu-tokenizer.cc \
|
||||||
mu-tokenizer.hh \
|
mu-tokenizer.hh \
|
||||||
mu-tree.hh \
|
mu-tree.hh \
|
||||||
mu-xapian.cc \
|
mu-xapian.cc \
|
||||||
mu-xapian.hh \
|
mu-xapian.hh \
|
||||||
mu-maildir.cc \
|
mu-maildir.cc \
|
||||||
mu-maildir.hh \
|
mu-maildir.hh \
|
||||||
mu-flags.cc \
|
mu-flags.cc \
|
||||||
mu-flags.hh \
|
mu-flags.hh \
|
||||||
mu-msg-crypto.cc \
|
mu-msg-crypto.cc \
|
||||||
mu-msg-doc.cc \
|
mu-msg-doc.cc \
|
||||||
mu-msg-doc.hh \
|
mu-msg-doc.hh \
|
||||||
mu-msg-fields.c \
|
mu-msg-fields.c \
|
||||||
mu-msg-fields.h \
|
mu-msg-fields.h \
|
||||||
mu-msg-file.cc \
|
mu-msg-file.cc \
|
||||||
mu-msg-file.hh \
|
mu-msg-file.hh \
|
||||||
mu-msg-part.cc \
|
mu-msg-part.cc \
|
||||||
mu-msg-part.hh \
|
mu-msg-part.hh \
|
||||||
mu-msg-prio.c \
|
mu-msg-prio.c \
|
||||||
mu-msg-prio.h \
|
mu-msg-prio.h \
|
||||||
mu-msg-priv.hh \
|
mu-msg-priv.hh \
|
||||||
mu-msg-sexp.cc \
|
mu-msg-sexp.cc \
|
||||||
mu-msg.cc \
|
mu-msg.cc \
|
||||||
mu-msg.hh
|
mu-msg.hh
|
||||||
|
|
||||||
libmu_la_LIBADD= \
|
libmu_la_LIBADD= \
|
||||||
$(XAPIAN_LIBS) \
|
$(XAPIAN_LIBS) \
|
||||||
$(GMIME_LIBS) \
|
$(GMIME_LIBS) \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
$(GUILE_LIBS) \
|
$(GUILE_LIBS) \
|
||||||
${builddir}/index/libmu-index.la \
|
${builddir}/index/libmu-index.la \
|
||||||
$(CODE_COVERAGE_LIBS)
|
$(CODE_COVERAGE_LIBS)
|
||||||
|
|
||||||
libmu_la_LDFLAGS= \
|
libmu_la_LDFLAGS= \
|
||||||
$(ASAN_LDFLAGS)
|
$(ASAN_LDFLAGS)
|
||||||
|
|
||||||
noinst_PROGRAMS= \
|
noinst_PROGRAMS= \
|
||||||
tokenize
|
tokenize
|
||||||
|
|
||||||
tokenize_SOURCES= \
|
tokenize_SOURCES= \
|
||||||
tokenize.cc
|
tokenize.cc
|
||||||
|
|
||||||
tokenize_LDADD= \
|
tokenize_LDADD= \
|
||||||
$(WARN_LDFLAGS) \
|
$(WARN_LDFLAGS) \
|
||||||
libmu.la \
|
libmu.la \
|
||||||
utils/libmu-utils.la
|
utils/libmu-utils.la
|
||||||
|
|
||||||
EXTRA_DIST= \
|
EXTRA_DIST= \
|
||||||
doxyfile.in
|
doxyfile.in
|
||||||
|
|
||||||
noinst_PROGRAMS+=$(TEST_PROGS)
|
noinst_PROGRAMS+=$(TEST_PROGS)
|
||||||
|
|
||||||
noinst_LTLIBRARIES+= \
|
noinst_LTLIBRARIES+= \
|
||||||
libtestmucommon.la
|
libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-maildir
|
TEST_PROGS += test-maildir
|
||||||
test_mu_maildir_SOURCES= test-mu-maildir.cc
|
test_maildir_SOURCES= test-mu-maildir.cc
|
||||||
test_mu_maildir_LDADD= libtestmucommon.la
|
test_maildir_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-msg-fields
|
TEST_PROGS += test-msg-fields
|
||||||
test_mu_msg_fields_SOURCES= test-mu-msg-fields.cc
|
test_msg_fields_SOURCES= test-mu-msg-fields.cc
|
||||||
test_mu_msg_fields_LDADD= libtestmucommon.la
|
test_msg_fields_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-msg
|
TEST_PROGS += test-msg
|
||||||
test_mu_msg_SOURCES= test-mu-msg.cc
|
test_msg_SOURCES= test-mu-msg.cc
|
||||||
test_mu_msg_LDADD= libtestmucommon.la
|
test_msg_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-store
|
TEST_PROGS += test-store
|
||||||
test_mu_store_SOURCES= test-mu-store.cc
|
test_store_SOURCES= test-mu-store.cc
|
||||||
test_mu_store_LDADD= libtestmucommon.la
|
test_store_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-query
|
TEST_PROGS += test-query
|
||||||
test_mu_query_SOURCES= test-query.cc
|
test_query_SOURCES= test-query.cc
|
||||||
test_mu_query_LDADD= libtestmucommon.la
|
test_query_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-flags
|
TEST_PROGS += test-flags
|
||||||
test_mu_flags_SOURCES= test-mu-flags.cc
|
test_flags_SOURCES= test-mu-flags.cc
|
||||||
test_mu_flags_LDADD= libtestmucommon.la
|
test_flags_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS += test-mu-contacts
|
TEST_PROGS+=test-tokenizer
|
||||||
test_mu_contacts_SOURCES= test-mu-contacts.cc
|
test_tokenizer_SOURCES=test-tokenizer.cc
|
||||||
test_mu_contacts_LDADD= libtestmucommon.la
|
test_tokenizer_LDADD=libtestmucommon.la
|
||||||
|
|
||||||
TEST_PROGS+=test-mu-tokenizer
|
TEST_PROGS+=test-threader
|
||||||
test_mu_tokenizer_SOURCES=test-tokenizer.cc
|
test_threader_SOURCES=mu-query-threader.cc
|
||||||
test_mu_tokenizer_LDADD=libtestmucommon.la
|
test_threader_LDADD=libtestmucommon.la
|
||||||
|
test_threader_CXXFLAGS=$(AM_CXXFLAGS) -DBUILD_TESTS
|
||||||
|
|
||||||
TEST_PROGS+=test-mu-threader
|
TEST_PROGS+=test-threads
|
||||||
test_mu_threader_SOURCES=mu-query-threader.cc
|
test_threads_SOURCES=mu-query-threads.cc
|
||||||
test_mu_threader_LDADD=libtestmucommon.la
|
test_threads_LDADD=libtestmucommon.la
|
||||||
test_mu_threader_CXXFLAGS=$(AM_CXXFLAGS) -DBUILD_THREADER_TEST
|
test_threads_CXXFLAGS=$(AM_CXXFLAGS) -DBUILD_TESTS
|
||||||
|
|
||||||
TEST_PROGS+=test-mu-parser
|
TEST_PROGS += test-contacts
|
||||||
test_mu_parser_SOURCES=test-parser.cc
|
test_contacts_SOURCES= mu-contacts.cc
|
||||||
test_mu_parser_LDADD=libtestmucommon.la
|
test_contacts_CXXFLAGS=$(AM_CXXFLAGS) -DBUILD_TESTS
|
||||||
|
test_contacts_LDADD= libtestmucommon.la
|
||||||
|
|
||||||
libtestmucommon_la_SOURCES= \
|
TEST_PROGS+=test-parser
|
||||||
test-mu-common.cc \
|
test_parser_SOURCES=test-parser.cc
|
||||||
test-mu-common.hh
|
test_parser_LDADD=libtestmucommon.la
|
||||||
|
|
||||||
libtestmucommon_la_LIBADD= \
|
libtestmucommon_la_SOURCES= \
|
||||||
libmu.la \
|
test-mu-common.cc \
|
||||||
utils/libmu-utils.la
|
test-mu-common.hh
|
||||||
|
|
||||||
|
libtestmucommon_la_LIBADD= \
|
||||||
|
libmu.la \
|
||||||
|
utils/libmu-utils.la
|
||||||
|
|
||||||
# note the question marks; make does not like files with ':', so we
|
# note the question marks; make does not like files with ':', so we
|
||||||
# use the (also supported) version with '!' instead. We could escape
|
# use the (also supported) version with '!' instead. We could escape
|
||||||
|
@ -191,103 +197,105 @@ libtestmucommon_la_LIBADD= \
|
||||||
|
|
||||||
# test messages, the '.ignore' message should be ignored
|
# test messages, the '.ignore' message should be ignored
|
||||||
# when indexing
|
# when indexing
|
||||||
EXTRA_DIST+= \
|
EXTRA_DIST+= \
|
||||||
testdir/tmp/1220863087.12663.ignore \
|
testdir/tmp/1220863087.12663.ignore \
|
||||||
testdir/new/1220863087.12663_9.mindcrime \
|
testdir/new/1220863087.12663_9.mindcrime \
|
||||||
testdir/new/1220863087.12663_25.mindcrime \
|
testdir/new/1220863087.12663_25.mindcrime \
|
||||||
testdir/new/1220863087.12663_21.mindcrime \
|
testdir/new/1220863087.12663_21.mindcrime \
|
||||||
testdir/new/1220863087.12663_23.mindcrime \
|
testdir/new/1220863087.12663_23.mindcrime \
|
||||||
testdir/cur/1220863087.12663_5.mindcrime!2,S \
|
testdir/cur/1220863087.12663_5.mindcrime!2,S \
|
||||||
testdir/cur/1220863087.12663_7.mindcrime!2,RS \
|
testdir/cur/1220863087.12663_7.mindcrime!2,RS \
|
||||||
testdir/cur/1220863087.12663_15.mindcrime!2,PS \
|
testdir/cur/1220863087.12663_15.mindcrime!2,PS \
|
||||||
testdir/cur/1220863087.12663_19.mindcrime!2,S \
|
testdir/cur/1220863087.12663_19.mindcrime!2,S \
|
||||||
testdir/cur/1220863042.12663_1.mindcrime!2,S \
|
testdir/cur/1220863042.12663_1.mindcrime!2,S \
|
||||||
testdir/cur/1220863060.12663_3.mindcrime!2,S \
|
testdir/cur/1220863060.12663_3.mindcrime!2,S \
|
||||||
testdir/cur/1283599333.1840_11.cthulhu!2, \
|
testdir/cur/1283599333.1840_11.cthulhu!2, \
|
||||||
testdir/cur/1305664394.2171_402.cthulhu!2, \
|
testdir/cur/1305664394.2171_402.cthulhu!2, \
|
||||||
testdir/cur/1252168370_3.14675.cthulhu!2,S \
|
testdir/cur/1252168370_3.14675.cthulhu!2,S \
|
||||||
testdir/cur/encrypted!2,S \
|
testdir/cur/encrypted!2,S \
|
||||||
testdir/cur/multimime!2,FS \
|
testdir/cur/multimime!2,FS \
|
||||||
testdir/cur/signed!2,S \
|
testdir/cur/signed!2,S \
|
||||||
testdir/cur/signed-encrypted!2,S \
|
testdir/cur/signed-encrypted!2,S \
|
||||||
testdir/cur/special!2,Sabc \
|
testdir/cur/special!2,Sabc \
|
||||||
testdir/cur/multirecip!2,S \
|
testdir/cur/multirecip!2,S \
|
||||||
testdir2/bar/cur/mail1 \
|
testdir2/bar/cur/mail1 \
|
||||||
testdir2/bar/cur/mail2 \
|
testdir2/bar/cur/mail2 \
|
||||||
testdir2/bar/cur/mail3 \
|
testdir2/bar/cur/mail3 \
|
||||||
testdir2/bar/cur/mail4 \
|
testdir2/bar/cur/mail4 \
|
||||||
testdir2/bar/cur/mail5 \
|
testdir2/bar/cur/mail5 \
|
||||||
testdir2/bar/cur/181736.eml \
|
testdir2/bar/cur/181736.eml \
|
||||||
testdir2/bar/cur/mail6 \
|
testdir2/bar/cur/mail6 \
|
||||||
testdir2/bar/tmp/.noindex \
|
testdir2/bar/tmp/.noindex \
|
||||||
testdir2/bar/new/.noindex \
|
testdir2/bar/new/.noindex \
|
||||||
testdir2/Foo/cur/mail5 \
|
testdir2/Foo/cur/mail5 \
|
||||||
testdir2/Foo/cur/arto.eml \
|
testdir2/Foo/cur/arto.eml \
|
||||||
testdir2/Foo/cur/fraiche.eml \
|
testdir2/Foo/cur/fraiche.eml \
|
||||||
testdir2/Foo/tmp/.noindex \
|
testdir2/Foo/tmp/.noindex \
|
||||||
testdir2/Foo/new/.noindex \
|
testdir2/Foo/new/.noindex \
|
||||||
testdir2/wom_bat/cur/atomic \
|
testdir2/wom_bat/cur/atomic \
|
||||||
testdir2/wom_bat/cur/rfc822.1 \
|
testdir2/wom_bat/cur/rfc822.1 \
|
||||||
testdir2/wom_bat/cur/rfc822.2 \
|
testdir2/wom_bat/cur/rfc822.2 \
|
||||||
testdir3/cycle \
|
testdir3/cycle \
|
||||||
testdir3/cycle/new/.noindex \
|
testdir3/cycle/new/.noindex \
|
||||||
testdir3/cycle/cur/rogue0 \
|
testdir3/cycle/cur/rogue0 \
|
||||||
testdir3/cycle/cur/cycle0 \
|
testdir3/cycle/cur/cycle0 \
|
||||||
testdir3/cycle/cur/cycle0.0 \
|
testdir3/cycle/cur/cycle0.0 \
|
||||||
testdir3/cycle/cur/cycle0.0.0 \
|
testdir3/cycle/cur/cycle0.0.0 \
|
||||||
testdir3/cycle/tmp/.noindex \
|
testdir3/cycle/tmp/.noindex \
|
||||||
testdir3/tree/new/.noindex \
|
testdir3/tree/new/.noindex \
|
||||||
testdir3/tree/cur/child0.0 \
|
testdir3/tree/cur/child0.0 \
|
||||||
testdir3/tree/cur/child4.0 \
|
testdir3/tree/cur/child4.0 \
|
||||||
testdir3/tree/cur/root2 \
|
testdir3/tree/cur/root2 \
|
||||||
testdir3/tree/cur/root1 \
|
testdir3/tree/cur/root1 \
|
||||||
testdir3/tree/cur/child3.0.0.0.0 \
|
testdir3/tree/cur/child3.0.0.0.0 \
|
||||||
testdir3/tree/cur/root0 \
|
testdir3/tree/cur/root0 \
|
||||||
testdir3/tree/cur/child2.0.0 \
|
testdir3/tree/cur/child2.0.0 \
|
||||||
testdir3/tree/cur/child0.1 \
|
testdir3/tree/cur/child0.1 \
|
||||||
testdir3/tree/cur/child0.1.0 \
|
testdir3/tree/cur/child0.1.0 \
|
||||||
testdir3/tree/cur/child4.1 \
|
testdir3/tree/cur/child4.1 \
|
||||||
testdir3/tree/tmp/.noindex \
|
testdir3/tree/tmp/.noindex \
|
||||||
testdir3/sort/1st-child-promotes-thread/cur/A \
|
testdir3/sort/1st-child-promotes-thread/cur/A \
|
||||||
testdir3/sort/1st-child-promotes-thread/cur/B \
|
testdir3/sort/1st-child-promotes-thread/cur/B \
|
||||||
testdir3/sort/1st-child-promotes-thread/cur/C \
|
testdir3/sort/1st-child-promotes-thread/cur/C \
|
||||||
testdir3/sort/1st-child-promotes-thread/cur/D \
|
testdir3/sort/1st-child-promotes-thread/cur/D \
|
||||||
testdir3/sort/2nd-child-promotes-thread/cur/A \
|
testdir3/sort/2nd-child-promotes-thread/cur/A \
|
||||||
testdir3/sort/2nd-child-promotes-thread/cur/B \
|
testdir3/sort/2nd-child-promotes-thread/cur/B \
|
||||||
testdir3/sort/2nd-child-promotes-thread/cur/C \
|
testdir3/sort/2nd-child-promotes-thread/cur/C \
|
||||||
testdir3/sort/2nd-child-promotes-thread/cur/D \
|
testdir3/sort/2nd-child-promotes-thread/cur/D \
|
||||||
testdir3/sort/2nd-child-promotes-thread/cur/E \
|
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/A \
|
||||||
testdir3/sort/child-does-not-promote-thread/cur/X \
|
testdir3/sort/child-does-not-promote-thread/cur/X \
|
||||||
testdir3/sort/child-does-not-promote-thread/cur/Y \
|
testdir3/sort/child-does-not-promote-thread/cur/Y \
|
||||||
testdir3/sort/child-does-not-promote-thread/cur/Z \
|
testdir3/sort/child-does-not-promote-thread/cur/Z \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/A \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/A \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/B \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/B \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/C \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/C \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/D \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/D \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/E \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/E \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/F \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/F \
|
||||||
testdir3/sort/grandchild-promotes-only-subthread/cur/G \
|
testdir3/sort/grandchild-promotes-only-subthread/cur/G \
|
||||||
testdir3/sort/grandchild-promotes-thread/cur/A \
|
testdir3/sort/grandchild-promotes-thread/cur/A \
|
||||||
testdir3/sort/grandchild-promotes-thread/cur/B \
|
testdir3/sort/grandchild-promotes-thread/cur/B \
|
||||||
testdir3/sort/grandchild-promotes-thread/cur/C \
|
testdir3/sort/grandchild-promotes-thread/cur/C \
|
||||||
testdir3/sort/grandchild-promotes-thread/cur/D \
|
testdir3/sort/grandchild-promotes-thread/cur/D \
|
||||||
testdir3/sort/grandchild-promotes-thread/cur/E \
|
testdir3/sort/grandchild-promotes-thread/cur/E \
|
||||||
testdir4/1220863087.12663_19.mindcrime!2,S \
|
testdir4/1220863087.12663_19.mindcrime!2,S \
|
||||||
testdir4/1220863042.12663_1.mindcrime!2,S \
|
testdir4/1220863042.12663_1.mindcrime!2,S \
|
||||||
testdir4/1283599333.1840_11.cthulhu!2, \
|
testdir4/1283599333.1840_11.cthulhu!2, \
|
||||||
testdir4/1305664394.2171_402.cthulhu!2, \
|
testdir4/1305664394.2171_402.cthulhu!2, \
|
||||||
testdir4/1252168370_3.14675.cthulhu!2,S \
|
testdir4/1252168370_3.14675.cthulhu!2,S \
|
||||||
testdir4/mail1 \
|
testdir4/mail1 \
|
||||||
testdir4/mail5 \
|
testdir4/mail5 \
|
||||||
testdir4/181736.eml \
|
testdir4/181736.eml \
|
||||||
testdir4/encrypted!2,S \
|
testdir4/encrypted!2,S \
|
||||||
testdir4/multimime!2,FS \
|
testdir4/multimime!2,FS \
|
||||||
testdir4/signed!2,S \
|
testdir4/signed!2,S \
|
||||||
testdir4/signed-bad!2,S \
|
testdir4/signed-bad!2,S \
|
||||||
testdir4/signed-encrypted!2,S \
|
testdir4/signed-encrypted!2,S \
|
||||||
testdir4/special!2,Sabc
|
testdir4/special!2,Sabc
|
||||||
|
|
||||||
TESTS=$(TEST_PROGS)
|
TESTS=$(TEST_PROGS)
|
||||||
|
|
||||||
|
CLEANFILES=*.log *.trs *core* *vgdump* *.gcda *.gcno
|
||||||
|
|
||||||
include $(top_srcdir)/aminclude_static.am
|
include $(top_srcdir)/aminclude_static.am
|
||||||
|
|
|
@ -227,7 +227,6 @@ Contacts::add (ContactInfo&& ci)
|
||||||
auto it = priv_->contacts_.find(ci.email);
|
auto it = priv_->contacts_.find(ci.email);
|
||||||
|
|
||||||
if (it == priv_->contacts_.end()) { // completely new contact
|
if (it == priv_->contacts_.end()) { // completely new contact
|
||||||
|
|
||||||
wash(ci.name);
|
wash(ci.name);
|
||||||
wash(ci.full_address);
|
wash(ci.full_address);
|
||||||
auto email{ci.email};
|
auto email{ci.email};
|
||||||
|
@ -316,40 +315,94 @@ Contacts::is_personal(const std::string& addr) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// C binding
|
#ifdef BUILD_TESTS
|
||||||
|
/*
|
||||||
|
* Tests.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
size_t
|
#include "test-mu-common.hh"
|
||||||
mu_contacts_count (const MuContacts *self)
|
|
||||||
|
static void
|
||||||
|
test_mu_contacts_01()
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (self, 0);
|
Mu::Contacts contacts ("");
|
||||||
|
|
||||||
auto myself = reinterpret_cast<const Mu::Contacts*>(self);
|
g_assert_true (contacts.empty());
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 0);
|
||||||
|
|
||||||
return myself->size();
|
contacts.add(Mu::ContactInfo ("Foo <foo.bar@example.com>",
|
||||||
|
"foo.bar@example.com", "Foo", false, 12345));
|
||||||
|
g_assert_false (contacts.empty());
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 1);
|
||||||
|
|
||||||
|
contacts.add(Mu::ContactInfo ("Cuux <cuux.fnorb@example.com>",
|
||||||
|
"cuux@example.com", "Cuux", false, 54321));
|
||||||
|
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 2);
|
||||||
|
|
||||||
|
contacts.add(Mu::ContactInfo ("foo.bar@example.com",
|
||||||
|
"foo.bar@example.com", "Foo", false, 77777));
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 2);
|
||||||
|
|
||||||
|
contacts.add(Mu::ContactInfo ("Foo.Bar@Example.Com",
|
||||||
|
"Foo.Bar@Example.Com", "Foo", false, 88888));
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 2);
|
||||||
|
// note: replaces first.
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto info = contacts._find("bla@example.com");
|
||||||
|
g_assert_false (info);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const auto info = contacts._find("foo.BAR@example.com");
|
||||||
|
g_assert_true (info);
|
||||||
|
|
||||||
|
g_assert_cmpstr(info->email.c_str(), ==, "Foo.Bar@Example.Com");
|
||||||
|
}
|
||||||
|
|
||||||
|
contacts.clear();
|
||||||
|
g_assert_true (contacts.empty());
|
||||||
|
g_assert_cmpuint (contacts.size(), ==, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
static void
|
||||||
mu_contacts_foreach (const MuContacts *self, MuContactsForeachFunc func,
|
test_mu_contacts_02()
|
||||||
gpointer user_data)
|
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (self, FALSE);
|
Mu::StringVec personal = {
|
||||||
g_return_val_if_fail (func, FALSE);
|
"foo@example.com",
|
||||||
|
"bar@cuux.org",
|
||||||
|
"/bar-.*@fnorb.f./"
|
||||||
|
};
|
||||||
|
Mu::Contacts contacts{"", personal};
|
||||||
|
|
||||||
auto myself = reinterpret_cast<const Mu::Contacts*>(self);
|
g_assert_true (contacts.is_personal("foo@example.com"));
|
||||||
|
g_assert_true (contacts.is_personal("Bar@CuuX.orG"));
|
||||||
|
g_assert_true (contacts.is_personal("bar-123abc@fnorb.fi"));
|
||||||
|
g_assert_true (contacts.is_personal("bar-zzz@fnorb.fr"));
|
||||||
|
|
||||||
myself->for_each([&](const ContactInfo& ci) {
|
g_assert_false (contacts.is_personal("foo@bar.com"));
|
||||||
g_return_if_fail (!ci.email.empty());
|
g_assert_false (contacts.is_personal("BÂr@CuuX.orG"));
|
||||||
func(ci.full_address.c_str(),
|
g_assert_false (contacts.is_personal("bar@fnorb.fi"));
|
||||||
ci.email.c_str(),
|
g_assert_false (contacts.is_personal("bar-zzz@fnorb.xr"));
|
||||||
ci.name.empty() ? NULL : ci.name.c_str(),
|
|
||||||
ci.personal,
|
|
||||||
ci.last_seen,
|
|
||||||
ci.freq,
|
|
||||||
ci.tstamp,
|
|
||||||
user_data);
|
|
||||||
});
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _MuContacts : public Mu::Contacts {}; /**< c-compat */
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
{
|
||||||
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
|
g_test_add_func ("/mu-contacts/01", test_mu_contacts_01);
|
||||||
|
g_test_add_func ("/mu-contacts/02", test_mu_contacts_02);
|
||||||
|
|
||||||
|
g_log_set_handler (NULL,
|
||||||
|
(GLogLevelFlags)
|
||||||
|
(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION),
|
||||||
|
(GLogFunc)black_hole, NULL);
|
||||||
|
|
||||||
|
return g_test_run ();
|
||||||
|
}
|
||||||
|
#endif /*BUILD_TESTS*/
|
||||||
|
|
|
@ -22,12 +22,6 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
struct _MuContacts;
|
|
||||||
typedef struct _MuContacts MuContacts;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
@ -155,17 +149,6 @@ public:
|
||||||
*/
|
*/
|
||||||
void for_each (const EachContactFunc& each_contact) const;
|
void for_each (const EachContactFunc& each_contact) const;
|
||||||
|
|
||||||
/**
|
|
||||||
* For C compatiblityy
|
|
||||||
*
|
|
||||||
* @return a MuContacts* referring to this.
|
|
||||||
*/
|
|
||||||
const MuContacts* mu_contacts() const {
|
|
||||||
return reinterpret_cast<const MuContacts*>(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Private;
|
struct Private;
|
||||||
std::unique_ptr<Private> priv_;
|
std::unique_ptr<Private> priv_;
|
||||||
|
@ -173,48 +156,4 @@ private:
|
||||||
|
|
||||||
} // namespace Mu
|
} // namespace Mu
|
||||||
|
|
||||||
#endif /*__cplusplus*/
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* return the number of contacts
|
|
||||||
*
|
|
||||||
* @param self a contacts object
|
|
||||||
*
|
|
||||||
* @return the number of contacts
|
|
||||||
*/
|
|
||||||
size_t mu_contacts_count (const MuContacts *self);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called for mu_contacts_foreach; returns the e-mail address, name
|
|
||||||
* (which may be NULL) , whether the message is 'personal', the timestamp for
|
|
||||||
* the address (when it was last seen), and the frequency (in how many message
|
|
||||||
* did this contact participate) and the tstamp (last modification)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef void (*MuContactsForeachFunc) (const char *full_address,
|
|
||||||
const char *email, const char *name,
|
|
||||||
gboolean personal,
|
|
||||||
time_t last_seen, unsigned freq,
|
|
||||||
gint64 tstamp, gpointer user_data);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* call a function for either each contact, or each contact satisfying
|
|
||||||
* a regular expression,
|
|
||||||
*
|
|
||||||
* @param self contacts object
|
|
||||||
* @param func callback function to be called for each
|
|
||||||
* @param user_data user data to pass to the callback
|
|
||||||
*
|
|
||||||
* @return TRUE if the function succeeded, or FALSE if the provide regular
|
|
||||||
* expression was invalid (and not NULL)
|
|
||||||
*/
|
|
||||||
gboolean mu_contacts_foreach (const MuContacts *self,
|
|
||||||
MuContactsForeachFunc func,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __MU_CONTACTS_HH__ */
|
#endif /* __MU_CONTACTS_HH__ */
|
||||||
|
|
|
@ -1,108 +0,0 @@
|
||||||
/*
|
|
||||||
** Copyright (C) 2019 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
||||||
**
|
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
|
||||||
** under the terms of the GNU General Public License as published by the
|
|
||||||
** Free Software Foundation; either version 3, or (at your option) any
|
|
||||||
** later version.
|
|
||||||
**
|
|
||||||
** This program 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 General Public License for more details.
|
|
||||||
**
|
|
||||||
** You should have received a copy of the GNU General Public License
|
|
||||||
** along with this program; if not, write to the Free Software Foundation,
|
|
||||||
** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
**
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
#include "test-mu-common.hh"
|
|
||||||
#include "mu-contacts.hh"
|
|
||||||
|
|
||||||
static void
|
|
||||||
test_mu_contacts_01()
|
|
||||||
{
|
|
||||||
Mu::Contacts contacts ("");
|
|
||||||
|
|
||||||
g_assert_true (contacts.empty());
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 0);
|
|
||||||
|
|
||||||
contacts.add(Mu::ContactInfo ("Foo <foo.bar@example.com>",
|
|
||||||
"foo.bar@example.com", "Foo", false, 12345));
|
|
||||||
g_assert_false (contacts.empty());
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 1);
|
|
||||||
|
|
||||||
contacts.add(Mu::ContactInfo ("Cuux <cuux.fnorb@example.com>",
|
|
||||||
"cuux@example.com", "Cuux", false, 54321));
|
|
||||||
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 2);
|
|
||||||
|
|
||||||
contacts.add(Mu::ContactInfo ("foo.bar@example.com",
|
|
||||||
"foo.bar@example.com", "Foo", false, 77777));
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 2);
|
|
||||||
|
|
||||||
contacts.add(Mu::ContactInfo ("Foo.Bar@Example.Com",
|
|
||||||
"Foo.Bar@Example.Com", "Foo", false, 88888));
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 2);
|
|
||||||
// note: replaces first.
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto info = contacts._find("bla@example.com");
|
|
||||||
g_assert_false (info);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
const auto info = contacts._find("foo.BAR@example.com");
|
|
||||||
g_assert_true (info);
|
|
||||||
|
|
||||||
g_assert_cmpstr(info->email.c_str(), ==, "Foo.Bar@Example.Com");
|
|
||||||
}
|
|
||||||
|
|
||||||
contacts.clear();
|
|
||||||
g_assert_true (contacts.empty());
|
|
||||||
g_assert_cmpuint (contacts.size(), ==, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
test_mu_contacts_02()
|
|
||||||
{
|
|
||||||
Mu::StringVec personal = {
|
|
||||||
"foo@example.com",
|
|
||||||
"bar@cuux.org",
|
|
||||||
"/bar-.*@fnorb.f./"
|
|
||||||
};
|
|
||||||
Mu::Contacts contacts{"", personal};
|
|
||||||
|
|
||||||
g_assert_true (contacts.is_personal("foo@example.com"));
|
|
||||||
g_assert_true (contacts.is_personal("Bar@CuuX.orG"));
|
|
||||||
g_assert_true (contacts.is_personal("bar-123abc@fnorb.fi"));
|
|
||||||
g_assert_true (contacts.is_personal("bar-zzz@fnorb.fr"));
|
|
||||||
|
|
||||||
g_assert_false (contacts.is_personal("foo@bar.com"));
|
|
||||||
g_assert_false (contacts.is_personal("BÂr@CuuX.orG"));
|
|
||||||
g_assert_false (contacts.is_personal("bar@fnorb.fi"));
|
|
||||||
g_assert_false (contacts.is_personal("bar-zzz@fnorb.xr"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
g_test_init (&argc, &argv, NULL);
|
|
||||||
|
|
||||||
g_test_add_func ("/mu-contacts/01", test_mu_contacts_01);
|
|
||||||
g_test_add_func ("/mu-contacts/02", test_mu_contacts_02);
|
|
||||||
|
|
||||||
g_log_set_handler (NULL,
|
|
||||||
(GLogLevelFlags)
|
|
||||||
(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION),
|
|
||||||
(GLogFunc)black_hole, NULL);
|
|
||||||
|
|
||||||
return g_test_run ();
|
|
||||||
}
|
|
Loading…
Reference in New Issue