update to use fmt-based apis

Not complete, but a first big stab converting users of Mu::Error and
various g_warning & friends, format to the new libfmt-based APIs.
This commit is contained in:
Dirk-Jan C. Binnema
2023-07-05 23:10:13 +03:00
parent 742ca33740
commit 4920b56671
46 changed files with 435 additions and 449 deletions

View File

@ -443,7 +443,7 @@ tear_down()
GError *err{};
const auto cmd{format("/bin/rm -rf '%s' '%s'", BENCH_MAILDIRS, BENCH_STORE)};
if (!g_spawn_command_line_sync(cmd.c_str(), NULL, NULL, NULL, &err)) {
g_warning("error: %s\n", err ? err->message : "?");
mu_warning("error: {}", err ? err->message : "?");
g_clear_error(&err);
}
}

View File

@ -47,12 +47,13 @@ assert_contacts_equal(const Contacts& contacts,
size_t n{};
for (auto&& contact: contacts) {
if (g_test_verbose())
g_message("{ \"%s\", \"%s\"},\n", contact.name.c_str(), contact.email.c_str());
mu_message("{{ \"{}\", \"{}\"}},\n",
contact.name, contact.email);
assert_equal(contact.name, expected.at(n).first);
assert_equal(contact.email, expected.at(n).second);
++n;
}
g_print("\n");
mu_print("\n");
}
@ -97,7 +98,7 @@ test_mu_msg_02(void)
g_assert_true(msg.priority() /* 'low' */
== Priority::Low);
g_assert_cmpuint(msg.date(), ==, 1218051515);
g_print("flags: %s\n", Mu::to_string(msg.flags()).c_str());
mu_println("flags: {}", Mu::to_string(msg.flags()));
g_assert_true(msg.flags() == (Flags::Seen|Flags::MailingList));
assert_contacts_equal(msg.all_contacts(), {