2010-08-26 20:21:29 +02:00
|
|
|
/*
|
2022-04-22 07:06:12 +02:00
|
|
|
** Copyright (C) 2008-2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
2010-08-26 20:21:29 +02:00
|
|
|
**
|
|
|
|
** 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,
|
2012-03-19 19:49:19 +01:00
|
|
|
** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
**
|
2010-08-26 20:21:29 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <time.h>
|
2022-04-22 07:06:12 +02:00
|
|
|
#include <array>
|
|
|
|
#include <string>
|
2010-08-26 20:21:29 +02:00
|
|
|
|
|
|
|
#include <locale.h>
|
|
|
|
|
2022-08-10 07:20:58 +02:00
|
|
|
#include "utils/mu-test-utils.hh"
|
2022-04-22 07:06:12 +02:00
|
|
|
#include "utils/mu-result.hh"
|
2022-02-19 17:57:50 +01:00
|
|
|
#include "utils/mu-utils.hh"
|
2010-08-26 20:21:29 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
#include <message/mu-message.hh>
|
2012-08-09 10:46:00 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
using namespace Mu;
|
2012-08-09 10:46:00 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
using ExpectedContacts = const std::vector<std::pair<std::string, std::string>>;
|
2012-08-09 10:46:00 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
static void
|
|
|
|
assert_contacts_equal(const Contacts& contacts,
|
|
|
|
const ExpectedContacts& expected)
|
|
|
|
{
|
|
|
|
g_assert_cmpuint(contacts.size(), ==, expected.size());
|
2022-04-28 22:00:17 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
size_t n{};
|
|
|
|
for (auto&& contact: contacts) {
|
2022-04-28 22:00:17 +02:00
|
|
|
if (g_test_verbose())
|
2023-07-05 22:10:13 +02:00
|
|
|
mu_message("{{ \"{}\", \"{}\"}},\n",
|
|
|
|
contact.name, contact.email);
|
2022-09-28 18:14:37 +02:00
|
|
|
assert_equal(contact.name, expected.at(n).first);
|
|
|
|
assert_equal(contact.email, expected.at(n).second);
|
2022-04-22 07:06:12 +02:00
|
|
|
++n;
|
2012-08-09 10:46:00 +02:00
|
|
|
}
|
2023-07-05 22:10:13 +02:00
|
|
|
mu_print("\n");
|
2012-08-09 10:46:00 +02:00
|
|
|
}
|
|
|
|
|
2010-08-26 20:21:29 +02:00
|
|
|
|
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_01(void)
|
2010-08-26 20:21:29 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1220863042.12663_1.mindcrime!2,S")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
assert_contacts_equal(msg.to(), {{ "Donald Duck", "gcc-help@gcc.gnu.org" }});
|
|
|
|
assert_contacts_equal(msg.from(), {{ "Mickey Mouse", "anon@example.com" }});
|
|
|
|
|
|
|
|
assert_equal(msg.subject(), "gcc include search order");
|
|
|
|
assert_equal(msg.message_id(),
|
|
|
|
"3BE9E6535E3029448670913581E7A1A20D852173@"
|
|
|
|
"emss35m06.us.lmco.com");
|
|
|
|
assert_equal(msg.header("Mailing-List").value_or(""),
|
|
|
|
"contact gcc-help-help@gcc.gnu.org; run by ezmlm");
|
|
|
|
g_assert_true(msg.priority() == Priority::Normal);
|
|
|
|
g_assert_cmpuint(msg.date(), ==, 1217530645);
|
|
|
|
|
|
|
|
assert_contacts_equal(msg.all_contacts(), {
|
|
|
|
{ "", "gcc-help-owner@gcc.gnu.org"},
|
|
|
|
{ "Mickey Mouse", "anon@example.com" },
|
|
|
|
{ "Donald Duck", "gcc-help@gcc.gnu.org" }
|
|
|
|
});
|
|
|
|
|
2010-08-26 20:21:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_02(void)
|
2010-08-26 20:21:29 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1220863087.12663_19.mindcrime!2,S")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
assert_equal(msg.to().at(0).email, "help-gnu-emacs@gnu.org");
|
|
|
|
assert_equal(msg.subject(), "Re: Learning LISP; Scheme vs elisp.");
|
|
|
|
assert_equal(msg.from().at(0).email, "anon@example.com");
|
|
|
|
assert_equal(msg.message_id(), "r6bpm5-6n6.ln1@news.ducksburg.com");
|
|
|
|
assert_equal(msg.header("Errors-To").value_or(""),
|
|
|
|
"help-gnu-emacs-bounces+xxxx.klub=gmail.com@gnu.org");
|
|
|
|
g_assert_true(msg.priority() /* 'low' */
|
2022-03-20 13:12:41 +01:00
|
|
|
== Priority::Low);
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_cmpuint(msg.date(), ==, 1218051515);
|
2023-07-05 22:10:13 +02:00
|
|
|
mu_println("flags: {}", Mu::to_string(msg.flags()));
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_true(msg.flags() == (Flags::Seen|Flags::MailingList));
|
2022-02-19 17:57:50 +01:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_contacts_equal(msg.all_contacts(), {
|
2022-04-28 22:00:17 +02:00
|
|
|
{ "", "help-gnu-emacs-bounces+xxxx.klub=gmail.com@gnu.org"},
|
|
|
|
{ "", "anon@example.com"},
|
|
|
|
{ "", "help-gnu-emacs@gnu.org"},
|
2022-04-22 07:06:12 +02:00
|
|
|
});
|
2012-03-19 19:49:19 +01:00
|
|
|
|
2010-09-10 19:37:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_03(void)
|
2010-09-10 19:37:06 +02:00
|
|
|
{
|
2022-04-22 07:06:12 +02:00
|
|
|
//const GSList* params;
|
|
|
|
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1283599333.1840_11.cthulhu!2,")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
assert_equal(msg.to().at(0).display_name(), "Bilbo Baggins <bilbo@anotherexample.com>");
|
|
|
|
assert_equal(msg.subject(), "Greetings from Lothlórien");
|
|
|
|
assert_equal(msg.from().at(0).display_name(), "Frodo Baggins <frodo@example.com>");
|
|
|
|
g_assert_true(msg.priority() == Priority::Normal);
|
|
|
|
g_assert_cmpuint(msg.date(), ==, 0);
|
|
|
|
assert_equal(msg.body_text().value_or(""),
|
|
|
|
"\nLet's write some fünkÿ text\nusing umlauts.\n\nFoo.\n");
|
|
|
|
|
|
|
|
// params = mu_msg_get_body_text_content_type_parameters(msg, MU_MSG_OPTION_NONE);
|
|
|
|
// g_assert_cmpuint(g_slist_length((GSList*)params), ==, 2);
|
|
|
|
|
|
|
|
// assert_equal((char*)params->data, "charset");
|
|
|
|
// params = g_slist_next(params);
|
|
|
|
// assert_equal((char*)params->data, "UTF-8");
|
|
|
|
g_assert_true(msg.flags() == (Flags::Unread));
|
2010-08-26 20:21:29 +02:00
|
|
|
}
|
|
|
|
|
2010-11-20 17:41:57 +01:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_04(void)
|
2010-11-20 17:41:57 +01:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/mail5").value()};
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_equal(msg.to().at(0).display_name(), "George Custer <gac@example.com>");
|
|
|
|
assert_equal(msg.subject(), "pics for you");
|
|
|
|
assert_equal(msg.from().at(0).display_name(), "Sitting Bull <sb@example.com>");
|
|
|
|
g_assert_true(msg.priority() /* 'low' */
|
2022-03-20 13:12:41 +01:00
|
|
|
== Priority::Normal);
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_cmpuint(msg.date(), ==, 0);
|
|
|
|
g_assert_true(msg.flags() ==
|
2022-03-20 13:12:41 +01:00
|
|
|
(Flags::HasAttachment|Flags::Unread));
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_true(msg.flags() ==
|
2022-03-20 13:12:41 +01:00
|
|
|
(Flags::HasAttachment|Flags::Unread));
|
2010-11-20 17:41:57 +01:00
|
|
|
}
|
|
|
|
|
2012-05-20 09:57:23 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_multimime(void)
|
2012-05-20 09:57:23 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/multimime!2,FS").value()};
|
2012-05-20 09:57:23 +02:00
|
|
|
|
|
|
|
/* ie., are text parts properly concatenated? */
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_equal(msg.subject(), "multimime");
|
|
|
|
assert_equal(msg.body_text().value_or(""), "abcdef");
|
|
|
|
g_assert_true(msg.flags() == (Flags::HasAttachment|Flags::Flagged|Flags::Seen));
|
2012-05-20 09:57:23 +02:00
|
|
|
}
|
|
|
|
|
2012-06-01 14:04:18 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_flags(void)
|
2012-06-01 14:04:18 +02:00
|
|
|
{
|
2022-04-22 07:06:12 +02:00
|
|
|
std::array<std::pair<std::string, Flags>, 2> tests= {{
|
|
|
|
{MU_TESTMAILDIR4 "/multimime!2,FS",
|
2022-03-20 13:12:41 +01:00
|
|
|
(Flags::Flagged | Flags::Seen |
|
|
|
|
Flags::HasAttachment)},
|
|
|
|
{MU_TESTMAILDIR4 "/special!2,Sabc",
|
2022-06-09 23:45:08 +02:00
|
|
|
(Flags::Seen)}
|
2022-04-22 07:06:12 +02:00
|
|
|
}};
|
2012-06-01 14:04:18 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
for (auto&& test: tests) {
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg = Message::make_from_path(test.first);
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_valid_result(msg);
|
|
|
|
g_assert_true(msg->flags() == test.second);
|
2012-06-01 14:04:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-18 20:21:10 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_umlaut(void)
|
2011-05-18 20:21:10 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1305664394.2171_402.cthulhu!2,")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_contacts_equal(msg.to(), { { "Helmut Kröger", "hk@testmu.xxx"}});
|
2022-09-28 18:14:37 +02:00
|
|
|
assert_contacts_equal(msg.from(), { { "Mü", "testmu@testmu.xx"}});
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_equal(msg.subject(), "Motörhead");
|
|
|
|
assert_equal(msg.from().at(0).display_name(), "Mü <testmu@testmu.xx>");
|
|
|
|
g_assert_true(msg.priority() == Priority::Normal);
|
|
|
|
g_assert_cmpuint(msg.date(), ==, 0);
|
2011-05-18 20:21:10 +02:00
|
|
|
}
|
|
|
|
|
2011-06-23 23:24:04 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_references(void)
|
2011-06-23 23:24:04 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1305664394.2171_402.cthulhu!2,")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
std::array<std::string, 4> expected_refs = {
|
|
|
|
"non-exist-01@msg.id",
|
|
|
|
"non-exist-02@msg.id",
|
|
|
|
"non-exist-03@msg.id",
|
|
|
|
"non-exist-04@msg.id"
|
|
|
|
};
|
2012-03-19 19:49:19 +01:00
|
|
|
|
2022-08-10 07:20:58 +02:00
|
|
|
assert_equal_seq_str(msg.references(), expected_refs);
|
|
|
|
assert_equal(msg.thread_id(), expected_refs[0]);
|
2011-06-23 23:24:04 +02:00
|
|
|
}
|
|
|
|
|
2011-06-30 22:43:08 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_references_dups(void)
|
2011-06-30 22:43:08 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/1252168370_3.14675.cthulhu!2,S")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
std::array<std::string, 6> expected_refs = {
|
|
|
|
"439C1136.90504@euler.org",
|
|
|
|
"4399DD94.5070309@euler.org",
|
|
|
|
"20051209233303.GA13812@gauss.org",
|
|
|
|
"439B41ED.2080402@euler.org",
|
|
|
|
"439A1E03.3090604@euler.org",
|
|
|
|
"20051211184308.GB13513@gauss.org"
|
|
|
|
};
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-08-10 07:20:58 +02:00
|
|
|
assert_equal_seq_str(msg.references(), expected_refs);
|
|
|
|
assert_equal(msg.thread_id(), expected_refs[0]);
|
2012-03-19 19:49:19 +01:00
|
|
|
}
|
2011-06-23 23:24:04 +02:00
|
|
|
|
2012-12-28 11:50:02 +01:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_references_many(void)
|
2012-12-28 11:50:02 +01:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR2 "/bar/cur/181736.eml")
|
2022-04-22 07:06:12 +02:00
|
|
|
.value()};
|
|
|
|
|
|
|
|
std::array<std::string, 11> expected_refs = {
|
|
|
|
"e9065dac-13c1-4103-9e31-6974ca232a89@t15g2000prt.googlegroups.com",
|
|
|
|
"87hbblwelr.fsf@sapphire.mobileactivedefense.com",
|
|
|
|
"pql248-4va.ln1@wilbur.25thandClement.com",
|
|
|
|
"ikns6r$li3$1@Iltempo.Update.UU.SE",
|
|
|
|
"8762s0jreh.fsf@sapphire.mobileactivedefense.com",
|
|
|
|
"ikqqp1$jv0$1@Iltempo.Update.UU.SE",
|
|
|
|
"87hbbjc5jt.fsf@sapphire.mobileactivedefense.com",
|
|
|
|
"ikr0na$lru$1@Iltempo.Update.UU.SE",
|
|
|
|
"tO8cp.1228$GE6.370@news.usenetserver.com",
|
|
|
|
"ikr6ks$nlf$1@Iltempo.Update.UU.SE",
|
|
|
|
"8ioh48-8mu.ln1@leafnode-msgid.gclare.org.uk"
|
|
|
|
};
|
2012-12-28 11:50:02 +01:00
|
|
|
|
2022-08-10 07:20:58 +02:00
|
|
|
assert_equal_seq_str(msg.references(), expected_refs);
|
|
|
|
assert_equal(msg.thread_id(), expected_refs[0]);
|
2012-12-28 11:50:02 +01:00
|
|
|
}
|
|
|
|
|
2011-06-15 23:49:30 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_tags(void)
|
2011-06-15 23:49:30 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/mail1").value()};
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_contacts_equal(msg.to(), {{ "Julius Caesar", "jc@example.com" }});
|
|
|
|
assert_contacts_equal(msg.from(), {{ "John Milton", "jm@example.com" }});
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_equal(msg.subject(),"Fere libenter homines id quod volunt credunt");
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_true(msg.priority() == Priority::High);
|
|
|
|
g_assert_cmpuint(msg.date(), ==, 1217530645);
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
std::array<std::string, 4> expected_tags = {
|
|
|
|
"Paradise",
|
|
|
|
"losT",
|
|
|
|
"john",
|
|
|
|
"milton"
|
|
|
|
};
|
|
|
|
assert_equal_seq_str(msg.tags(), expected_tags);
|
2011-06-15 23:49:30 +02:00
|
|
|
}
|
2012-03-19 19:49:19 +01:00
|
|
|
|
2011-06-08 07:33:30 +02:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_msg_comp_unix_programmer(void)
|
2011-06-08 07:33:30 +02:00
|
|
|
{
|
2022-04-28 22:00:17 +02:00
|
|
|
auto msg{Message::make_from_path(MU_TESTMAILDIR4 "/181736.eml").value()};
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_true(msg.to().empty());
|
|
|
|
assert_equal(msg.subject(),
|
2022-03-20 13:12:41 +01:00
|
|
|
"Re: Are writes \"atomic\" to readers of the file?");
|
2022-04-22 07:06:12 +02:00
|
|
|
assert_equal(msg.from().at(0).display_name(), "Jimbo Foobarcuux <jimbo@slp53.sl.home>");
|
|
|
|
assert_equal(msg.message_id(), "oktdp.42997$Te.22361@news.usenetserver.com");
|
2021-10-20 11:18:15 +02:00
|
|
|
|
2022-04-22 07:06:12 +02:00
|
|
|
auto refs = join(msg.references(), ',');
|
|
|
|
assert_equal(refs,
|
|
|
|
"e9065dac-13c1-4103-9e31-6974ca232a89@t15g2000prt"
|
2022-03-20 13:12:41 +01:00
|
|
|
".googlegroups.com,"
|
|
|
|
"87hbblwelr.fsf@sapphire.mobileactivedefense.com,"
|
|
|
|
"pql248-4va.ln1@wilbur.25thandClement.com,"
|
|
|
|
"ikns6r$li3$1@Iltempo.Update.UU.SE,"
|
|
|
|
"8762s0jreh.fsf@sapphire.mobileactivedefense.com,"
|
|
|
|
"ikqqp1$jv0$1@Iltempo.Update.UU.SE,"
|
|
|
|
"87hbbjc5jt.fsf@sapphire.mobileactivedefense.com,"
|
|
|
|
"ikr0na$lru$1@Iltempo.Update.UU.SE,"
|
|
|
|
"tO8cp.1228$GE6.370@news.usenetserver.com,"
|
|
|
|
"ikr6ks$nlf$1@Iltempo.Update.UU.SE,"
|
|
|
|
"8ioh48-8mu.ln1@leafnode-msgid.gclare.org.uk");
|
2012-03-19 19:49:19 +01:00
|
|
|
|
2011-06-08 07:33:30 +02:00
|
|
|
//"jimbo@slp53.sl.home (Jimbo Foobarcuux)";
|
2022-04-22 07:06:12 +02:00
|
|
|
g_assert_true(msg.priority() == Priority::Normal);
|
|
|
|
g_assert_cmpuint(msg.date(), ==, 1299603860);
|
2011-06-08 07:33:30 +02:00
|
|
|
}
|
2011-06-15 23:49:30 +02:00
|
|
|
|
2019-12-16 20:44:35 +01:00
|
|
|
static void
|
2021-10-20 11:18:15 +02:00
|
|
|
test_mu_str_prio_01(void)
|
2019-12-16 20:44:35 +01:00
|
|
|
{
|
2022-03-20 13:12:41 +01:00
|
|
|
g_assert_true(priority_name(Priority::Low) == "low");
|
|
|
|
g_assert_true(priority_name(Priority::Normal) == "normal");
|
|
|
|
g_assert_true(priority_name(Priority::High) == "high");
|
2019-12-16 20:44:35 +01:00
|
|
|
}
|
|
|
|
|
2022-02-13 13:32:10 +01:00
|
|
|
G_GNUC_UNUSED static gboolean
|
2021-10-20 11:18:15 +02:00
|
|
|
ignore_error(const char* log_domain, GLogLevelFlags log_level, const gchar* msg, gpointer user_data)
|
2019-12-16 20:44:35 +01:00
|
|
|
{
|
|
|
|
return FALSE; /* don't abort */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-26 20:21:29 +02:00
|
|
|
int
|
2021-10-20 11:18:15 +02:00
|
|
|
main(int argc, char* argv[])
|
2010-08-26 20:21:29 +02:00
|
|
|
{
|
2011-05-19 21:24:12 +02:00
|
|
|
int rv;
|
2012-03-14 20:33:06 +01:00
|
|
|
|
2021-10-20 11:18:15 +02:00
|
|
|
g_test_init(&argc, &argv, NULL);
|
2011-05-19 21:24:12 +02:00
|
|
|
|
|
|
|
/* mu_msg_str_date */
|
2021-10-20 11:18:15 +02:00
|
|
|
g_test_add_func("/mu-msg/mu-msg-01", test_mu_msg_01);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-02", test_mu_msg_02);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-03", test_mu_msg_03);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-04", test_mu_msg_04);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-multimime", test_mu_msg_multimime);
|
2012-03-19 19:49:19 +01:00
|
|
|
|
2021-10-20 11:18:15 +02:00
|
|
|
g_test_add_func("/mu-msg/mu-msg-flags", test_mu_msg_flags);
|
2019-12-16 20:44:35 +01:00
|
|
|
|
2021-10-20 11:18:15 +02:00
|
|
|
g_test_add_func("/mu-msg/mu-msg-tags", test_mu_msg_tags);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-references", test_mu_msg_references);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-references_dups", test_mu_msg_references_dups);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-references_many", test_mu_msg_references_many);
|
2019-12-16 20:44:35 +01:00
|
|
|
|
2021-10-20 11:18:15 +02:00
|
|
|
g_test_add_func("/mu-msg/mu-msg-umlaut", test_mu_msg_umlaut);
|
|
|
|
g_test_add_func("/mu-msg/mu-msg-comp-unix-programmer", test_mu_msg_comp_unix_programmer);
|
|
|
|
|
|
|
|
g_test_add_func("/mu-str/mu-str-prio-01", test_mu_str_prio_01);
|
2019-12-16 20:44:35 +01:00
|
|
|
|
2021-10-20 11:18:15 +02:00
|
|
|
rv = g_test_run();
|
2011-05-09 01:58:33 +02:00
|
|
|
|
2012-03-19 19:49:19 +01:00
|
|
|
return rv;
|
2010-08-26 20:21:29 +02:00
|
|
|
}
|