diff --git a/mu/mu-cmd-find.cc b/mu/mu-cmd-find.cc index af07ca20..97c0f72f 100644 --- a/mu/mu-cmd-find.cc +++ b/mu/mu-cmd-find.cc @@ -30,7 +30,7 @@ #include "mu-msg.h" #include "mu-maildir.h" -#include "mu-query.h" +#include "mu-query.hh" #include "mu-msg-iter.h" #include "mu-bookmarks.h" #include "mu-runtime.h" @@ -48,22 +48,11 @@ typedef gboolean (OutputFunc) (MuMsg *msg, MuMsgIter *iter, const MuConfig *opts, GError **err); static gboolean -print_internal (MuQuery *query, const gchar *expr, gboolean xapian, +print_internal (const Query& query, const gchar *expr, gboolean xapian, gboolean warn, GError **err) { - char *str; - - if (xapian) - str = mu_query_internal_xapian (query, expr, err); - else - str = mu_query_internal (query, expr, warn, err); - - if (str) { - g_print ("%s\n", str); - g_free (str); - } - - return str != NULL; + std::cout << query.parse(expr, xapian) << "\n"; + return TRUE; } @@ -112,11 +101,10 @@ get_message (MuMsgIter *iter, time_t after) } static MuMsgIter* -run_query (MuQuery *xapian, const gchar *query, const MuConfig *opts, GError **err) +run_query (const Query& q, const std::string& expr, const MuConfig *opts, GError **err) { MuMsgIter *iter; MuMsgFieldId sortid; - int qflags; sortid = MU_MSG_FIELD_ID_NONE; if (opts->sortfield) { @@ -125,19 +113,17 @@ run_query (MuQuery *xapian, const gchar *query, const MuConfig *opts, GError ** return FALSE; } - qflags = MU_QUERY_FLAG_NONE; + Mu::Query::Flags qflags{Query::Flags::None}; if (opts->reverse) - qflags |= MU_QUERY_FLAG_DESCENDING; + qflags |= Query::Flags::Descending; if (opts->skip_dups) - qflags |= MU_QUERY_FLAG_SKIP_DUPS; + qflags |= Query::Flags::SkipDups; if (opts->include_related) - qflags |= MU_QUERY_FLAG_INCLUDE_RELATED; + qflags |= Query::Flags::IncludeRelated; if (opts->threads) - qflags |= MU_QUERY_FLAG_THREADS; + qflags |= Query::Flags::Threading; - iter = mu_query_run (xapian, query, sortid, opts->maxnum, - (MuQueryFlags)qflags, err); - return iter; + return q.run(expr, sortid, qflags, opts->maxnum, err); } static gboolean @@ -216,28 +202,18 @@ get_query (const MuConfig *opts, GError **err) return query; } -static MuQuery* -get_query_obj (MuStore *store, GError **err) +static Mu::Query +get_query_obj (const Store& store, GError **err) { - MuQuery *mquery; - unsigned count; - - count = mu_store_count (store, err); + const auto count{store.size()}; if (count == (unsigned)-1) - return NULL; + throw Mu::Error(Error::Code::Store, "invalid store"); - if (count == 0) { - g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_XAPIAN_NEEDS_REINDEX, - "the database is empty"); - return NULL; - } + if (count == 0) + throw Mu::Error(Error::Code::Store, "store is empty"); - mquery = mu_query_new (store, err); - if (!mquery) - return NULL; - - return mquery; + return Mu::Query{store}; } static gboolean @@ -671,12 +647,11 @@ output_query_results (MuMsgIter *iter, const MuConfig *opts, GError **err) } static gboolean -process_query (MuQuery *xapian, const gchar *query, const MuConfig *opts, GError **err) +process_query (const Query& q, const gchar *expr, const MuConfig *opts, GError **err) { - MuMsgIter *iter; gboolean rv; - iter = run_query (xapian, query, opts, err); + auto iter = run_query (q, expr, opts, err); if (!iter) return FALSE; @@ -687,34 +662,21 @@ process_query (MuQuery *xapian, const gchar *query, const MuConfig *opts, GError } static gboolean -execute_find (MuStore *store, const MuConfig *opts, GError **err) +execute_find (const Store& store, const MuConfig *opts, GError **err) { - char *query_str; - MuQuery *oracle; - gboolean rv; + auto q{get_query_obj (store, err)}; - oracle = get_query_obj (store, err); - if (!oracle) + auto expr{get_query (opts, err)}; + if (!expr) return FALSE; - query_str = get_query (opts, err); - if (!query_str) { - mu_query_destroy (oracle); - return FALSE; - } - if (opts->format == MU_CONFIG_FORMAT_XQUERY) - rv = print_internal (oracle, query_str, TRUE, FALSE, err); + return print_internal (q, expr, TRUE, FALSE, err); else if (opts->format == MU_CONFIG_FORMAT_MQUERY) - rv = print_internal (oracle, query_str, FALSE, + return print_internal (q, expr, FALSE, opts->verbose, err); else - rv = process_query (oracle, query_str, opts, err); - - mu_query_destroy (oracle); - g_free (query_str); - - return rv; + return process_query (q, expr, opts, err); } static gboolean @@ -780,7 +742,7 @@ query_params_valid (const MuConfig *opts, GError **err) } MuError -mu_cmd_find (MuStore *store, const MuConfig *opts, GError **err) +mu_cmd_find (const Store& store, const MuConfig *opts, GError **err) { g_return_val_if_fail (opts, MU_ERROR_INTERNAL); g_return_val_if_fail (opts->cmd == MU_CONFIG_CMD_FIND, diff --git a/mu/mu-cmd.cc b/mu/mu-cmd.cc index dede3aba..76dc7d91 100644 --- a/mu/mu-cmd.cc +++ b/mu/mu-cmd.cc @@ -643,7 +643,7 @@ cmd_find (const MuConfig *opts, GError **err) { Mu::Store store{mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB), true/*readonly*/}; - return mu_cmd_find(reinterpret_cast(&store), opts, err); + return mu_cmd_find(store, opts, err); } static void diff --git a/mu/mu-cmd.hh b/mu/mu-cmd.hh index 23e3d438..8f6b50df 100644 --- a/mu/mu-cmd.hh +++ b/mu/mu-cmd.hh @@ -37,7 +37,7 @@ G_BEGIN_DECLS * >MU_OK (0) results, MU_EXITCODE_NO_MATCHES if the command * succeeds but there no matches, some error code for all other errors */ -MuError mu_cmd_find (MuStore* store, const MuConfig *opts, +MuError mu_cmd_find (const Mu::Store& store, const MuConfig *opts, GError **err); /** diff --git a/mu/test-mu-cmd-cfind.cc b/mu/test-mu-cmd-cfind.cc index 7bc2fe01..271b0607 100644 --- a/mu/test-mu-cmd-cfind.cc +++ b/mu/test-mu-cmd-cfind.cc @@ -1,4 +1,4 @@ -/* -*- mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- +/* ** ** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** @@ -27,9 +27,9 @@ #include #include -#include "test-mu-common.h" +#include "test-mu-common.hh" #include "mu-store.hh" -#include "mu-query.h" +#include "mu-query.hh" static gchar *CONTACTS_CACHE = NULL; diff --git a/mu/test-mu-cmd.cc b/mu/test-mu-cmd.cc index b40eb520..d82fe76c 100644 --- a/mu/test-mu-cmd.cc +++ b/mu/test-mu-cmd.cc @@ -30,9 +30,9 @@ #include #include -#include "test-mu-common.h" +#include "test-mu-common.hh" #include "mu-store.hh" -#include "mu-query.h" +#include "mu-query.hh" /* tests for the command line interface, uses testdir2 */ diff --git a/mu/test-mu-query.cc b/mu/test-mu-query.cc index bb2657bf..fc281105 100644 --- a/mu/test-mu-query.cc +++ b/mu/test-mu-query.cc @@ -1,7 +1,5 @@ -/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/ - /* -** Copyright (C) 2008-2017 Dirk-Jan C. Binnema +** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** ** 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 @@ -31,40 +29,41 @@ #include #include -#include "test-mu-common.h" -#include "mu-query.h" +#include "test-mu-common.hh" +#include "mu-query.hh" #include "utils/mu-str.h" +#include "utils/mu-utils.hh" #include "mu-store.hh" -static char* DB_PATH1 = NULL; -static char* DB_PATH2 = NULL; +using namespace Mu; -static gchar* -fill_database (const char *testdir) +static std::string DB_PATH1; +static std::string DB_PATH2; + +static std::string +make_database (const std::string& testdir) { - gchar *cmdline, *tmpdir, *xpath; - - tmpdir = test_mu_common_get_random_tmpdir(); - cmdline = g_strdup_printf ( - "/bin/sh -c '" - "%s init --muhome=%s --maildir=%s --quiet ; " - "%s index --muhome=%s --quiet'", - MU_PROGRAM, tmpdir, testdir, - MU_PROGRAM, tmpdir); + char *tmpdir{test_mu_common_get_random_tmpdir()}; + const auto cmdline{ + format("/bin/sh -c '" + "%s init --muhome=%s --maildir=%s --quiet ; " + "%s index --muhome=%s --quiet'", + MU_PROGRAM, tmpdir, testdir.c_str(), + MU_PROGRAM, tmpdir)}; if (g_test_verbose()) - g_printerr ("\n%s\n", cmdline); + g_printerr ("\n%s\n", cmdline.c_str()); - g_assert (g_spawn_command_line_sync (cmdline, NULL, NULL, + g_assert (g_spawn_command_line_sync (cmdline.c_str(), NULL, NULL, NULL, NULL)); - g_free (cmdline); - - xpath= g_strdup_printf ("%s%c%s", tmpdir, - G_DIR_SEPARATOR, "xapian"); + auto xpath= g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR, "xapian"); g_free (tmpdir); - return xpath; + std::string dbpath{xpath}; + g_free(xpath); + + return dbpath; } @@ -94,51 +93,24 @@ assert_no_dups (MuMsgIter *iter) /* note: this also *moves the iter* */ static guint -run_and_count_matches_with_query_flags (const char *xpath, const char *query, - MuQueryFlags flags) +run_and_count_matches (const std::string& xpath, const std::string& expr, + Mu::Query::Flags flags = Mu::Query::Flags::None) { - MuQuery *mquery; MuMsgIter *iter; - MuStore *store; guint count1, count2; - GError *err; - err = NULL; - store = mu_store_new_readable (xpath, &err); - if (err) { - g_printerr ("error: %s\n", err->message); - g_clear_error (&err); - err = NULL; - } - g_assert (store); - - mquery = mu_query_new (store, &err); - if (err) { - g_printerr ("error: %s\n", err->message); - g_clear_error (&err); - err = NULL; - } - - g_assert (mquery); - - mu_store_unref (store); + Mu::Store store{xpath}; + Mu::Query query{store}; if (g_test_verbose()) { - char *x; - g_print ("\n==> query: %s\n", query); - x = mu_query_internal (mquery, query, FALSE, NULL); - g_print ("==> mquery: '%s'\n", x); - g_free (x); - x = mu_query_internal_xapian (mquery, query, NULL); - g_print ("==> xquery: '%s'\n", x); - g_free (x); + std::cout << "==> mquery: " << query.parse (expr, false) << "\n"; + std::cout << "==> xquery: " << query.parse (expr, true) << "\n"; } - iter = mu_query_run (mquery, query, MU_MSG_FIELD_ID_NONE, -1, - flags, NULL); - mu_query_destroy (mquery); - g_assert (iter); + Mu::allow_warnings(); + iter = query.run (expr, MU_MSG_FIELD_ID_NONE, flags); + g_assert (iter); assert_no_dups (iter); /* run query twice, to test mu_msg_iter_reset */ @@ -159,13 +131,6 @@ run_and_count_matches_with_query_flags (const char *xpath, const char *query, return count1; } -static guint -run_and_count_matches (const char *xpath, const char *query) -{ - return run_and_count_matches_with_query_flags ( - xpath, query, MU_QUERY_FLAG_NONE); -} - typedef struct { const char *query; size_t count; /* expected number of matches */ @@ -302,21 +267,15 @@ test_mu_query_logic (void) static void test_mu_query_accented_chars_01 (void) { - MuQuery *query; MuMsgIter *iter; MuMsg *msg; - MuStore *store; GError *err; gchar *summ; - store = mu_store_new_readable (DB_PATH1, NULL); - g_assert (store); + Store store{DB_PATH1}; + Query q{store}; - query = mu_query_new (store, NULL); - mu_store_unref (store); - - iter = mu_query_run (query, "fünkÿ", MU_MSG_FIELD_ID_NONE, - -1, MU_QUERY_FLAG_NONE, NULL); + iter = q.run("fünkÿ"); err = NULL; msg = mu_msg_iter_get_msg_floating (iter); /* don't unref */ if (!msg) { @@ -336,7 +295,6 @@ test_mu_query_accented_chars_01 (void) g_free (summ); mu_msg_iter_destroy (iter); - mu_query_destroy (query); } static void @@ -410,7 +368,6 @@ test_mu_query_wildcards (void) static void test_mu_query_dates_helsinki (void) { - gchar *xpath; int i; const char *old_tz; @@ -424,15 +381,14 @@ test_mu_query_dates_helsinki (void) old_tz = set_tz ("Europe/Helsinki"); - xpath = fill_database (MU_TESTMAILDIR); - g_assert (xpath != NULL); + const auto xpath{make_database (MU_TESTMAILDIR)}; + g_assert_false (xpath.empty()); for (i = 0; i != G_N_ELEMENTS(queries); ++i) g_assert_cmpuint (run_and_count_matches (xpath, queries[i].query), ==, queries[i].count); - g_free (xpath); set_tz (old_tz); } @@ -440,10 +396,8 @@ test_mu_query_dates_helsinki (void) static void test_mu_query_dates_sydney (void) { - gchar *xpath; int i; const char *old_tz; - QResults queries[] = { { "date:20080731..20080804", 5}, { "date:20080731..20080804 s:gcc", 1}, @@ -454,23 +408,19 @@ test_mu_query_dates_sydney (void) old_tz = set_tz ("Australia/Sydney"); - xpath = fill_database (MU_TESTMAILDIR); - g_assert (xpath != NULL); + const auto xpath{make_database(MU_TESTMAILDIR)}; + g_assert_false (xpath.empty()); for (i = 0; i != G_N_ELEMENTS(queries); ++i) g_assert_cmpuint (run_and_count_matches (xpath, queries[i].query), ==, queries[i].count); - - g_free (xpath); set_tz (old_tz); - } static void test_mu_query_dates_la (void) { - gchar *xpath; int i; const char *old_tz; @@ -486,8 +436,8 @@ test_mu_query_dates_la (void) old_tz = set_tz ("America/Los_Angeles"); - xpath = fill_database (MU_TESTMAILDIR); - g_assert (xpath != NULL); + const auto xpath = make_database (MU_TESTMAILDIR); + g_assert_false (xpath.empty()); for (i = 0; i != G_N_ELEMENTS(queries); ++i) { /* g_print ("%s\n", queries[i].query); */ @@ -496,7 +446,6 @@ test_mu_query_dates_la (void) ==, queries[i].count); } - g_free (xpath); set_tz (old_tz); } @@ -671,26 +620,19 @@ test_mu_query_tags_02 (void) static void test_mu_query_threads_compilation_error (void) { - gchar *xpath; + const auto xpath = make_database (MU_TESTMAILDIR); + g_assert_false (xpath.empty()); - xpath = fill_database (MU_TESTMAILDIR); - g_assert (xpath != NULL); - - g_assert_cmpuint (run_and_count_matches_with_query_flags - (xpath, "msgid:uwsireh25.fsf@one.dot.net", - MU_QUERY_FLAG_NONE), + g_assert_cmpuint (run_and_count_matches + (xpath, "msgid:uwsireh25.fsf@one.dot.net"), ==, 1); - g_assert_cmpuint (run_and_count_matches_with_query_flags + g_assert_cmpuint (run_and_count_matches (xpath, "msgid:uwsireh25.fsf@one.dot.net", - MU_QUERY_FLAG_INCLUDE_RELATED), + Query::Flags::IncludeRelated), ==, 3); - - g_free (xpath); } - - int main (int argc, char *argv[]) { @@ -700,11 +642,11 @@ main (int argc, char *argv[]) g_test_init (&argc, &argv, NULL); - DB_PATH1 = fill_database (MU_TESTMAILDIR); - g_assert (DB_PATH1); + DB_PATH1 = make_database (MU_TESTMAILDIR); + g_assert_false (DB_PATH1.empty()); - DB_PATH2 = fill_database (MU_TESTMAILDIR2); - g_assert (DB_PATH2); + DB_PATH2 = make_database (MU_TESTMAILDIR2); + g_assert_false (DB_PATH2.empty()); g_test_add_func ("/mu-query/test-mu-query-01", test_mu_query_01); g_test_add_func ("/mu-query/test-mu-query-02", test_mu_query_02); @@ -753,15 +695,11 @@ main (int argc, char *argv[]) test_mu_query_threads_compilation_error); if (!g_test_verbose()) - g_log_set_handler (NULL, - (GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| - G_LOG_FLAG_RECURSION), - (GLogFunc)black_hole, NULL); - + g_log_set_handler (NULL, + (GLogLevelFlags)(G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| + G_LOG_LEVEL_WARNING|G_LOG_FLAG_RECURSION), + (GLogFunc)black_hole, NULL); rv = g_test_run (); - g_free (DB_PATH1); - g_free (DB_PATH2); - return rv; } diff --git a/mu/test-mu-threads.cc b/mu/test-mu-threads.cc index a05a551c..94eb05a1 100644 --- a/mu/test-mu-threads.cc +++ b/mu/test-mu-threads.cc @@ -1,7 +1,5 @@ -/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/ - /* -** Copyright (C) 2008-2013 Dirk-Jan C. Binnema +** Copyright (C) 2008-2020 Dirk-Jan C. Binnema ** ** 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 @@ -30,10 +28,12 @@ #include #include -#include "test-mu-common.h" -#include "mu-query.h" +#include "test-mu-common.hh" +#include "mu-query.hh" #include "utils/mu-str.h" +using namespace Mu; + struct _tinfo { const char *threadpath; const char *msgid; @@ -93,72 +93,59 @@ foreach_assert_tinfo_equal (MuMsgIter *iter, const tinfo items[], guint n_items) g_assert (u == n_items); } -static gchar* -fill_database (const char *testdir) +static std::string +make_database (const std::string& testdir) { - gchar *cmdline, *tmpdir, *xpath; + char *tmpdir{test_mu_common_get_random_tmpdir()}; + const auto cmdline{ + format("/bin/sh -c '" + "%s init --muhome=%s --maildir=%s --quiet ; " + "%s index --muhome=%s --quiet'", + MU_PROGRAM, tmpdir, testdir.c_str(), + MU_PROGRAM, tmpdir)}; - tmpdir = test_mu_common_get_random_tmpdir(); - cmdline = g_strdup_printf ( - "/bin/sh -c '" - "%s init --muhome=%s --maildir=%s --quiet ; " - "%s index --muhome=%s --quiet'", - MU_PROGRAM, tmpdir, testdir, - MU_PROGRAM, tmpdir); if (g_test_verbose()) - g_print ("%s\n", cmdline); + g_printerr ("\n%s\n", cmdline.c_str()); - g_assert (g_spawn_command_line_sync (cmdline, NULL, NULL, + g_assert (g_spawn_command_line_sync (cmdline.c_str(), NULL, NULL, NULL, NULL)); - g_free (cmdline); - xpath= g_strdup_printf ("%s%c%s", tmpdir, - G_DIR_SEPARATOR, "xapian"); + auto xpath= g_strdup_printf ("%s%c%s", tmpdir, G_DIR_SEPARATOR, "xapian"); g_free (tmpdir); - return xpath; + std::string dbpath{xpath}; + g_free(xpath); + + return dbpath; } + + /* note: this also *moves the iter* */ static MuMsgIter* -run_and_get_iter_full (const char *xpath, const char *query, - MuMsgFieldId sort_field, MuQueryFlags flags) +run_and_get_iter_full (const std::string& xpath, const std::string& expr, + MuMsgFieldId sort_field, + Mu::Query::Flags flags=Mu::Query::Flags::None) { - MuQuery *mquery; - MuStore *store; - MuMsgIter *iter; - int myflags; + Mu::Store store{xpath}; + Mu::Query q{store}; - store = mu_store_new_readable (xpath, NULL); - g_assert (store); - - mquery = mu_query_new (store, NULL); - mu_store_unref (store); - g_assert (query); - - myflags = flags; - myflags |= MU_QUERY_FLAG_THREADS; - iter = mu_query_run (mquery, query, sort_field, -1, - (MuQueryFlags)myflags, NULL); - mu_query_destroy (mquery); + const auto myflags{flags | Mu::Query::Flags::Threading}; + auto iter = q.run (expr, sort_field, myflags); g_assert (iter); return iter; } static MuMsgIter* -run_and_get_iter (const char *xpath, const char *query) +run_and_get_iter (const std::string& xpath, const char *query) { - return run_and_get_iter_full (xpath, query, MU_MSG_FIELD_ID_DATE, - MU_QUERY_FLAG_NONE); + return run_and_get_iter_full (xpath, query, MU_MSG_FIELD_ID_DATE); } static void test_mu_threads_01 (void) { - gchar *xpath; - MuMsgIter *iter; - const tinfo items [] = { {"0", "root0@msg.id", "root0"}, {"0:0", "child0.0@msg.id", "Re: child 0.0"}, @@ -176,23 +163,20 @@ test_mu_threads_01 (void) {"4:1", "child4.1@msg.id", "Re: child 4.1"} }; - xpath = fill_database (MU_TESTMAILDIR3); - g_assert (xpath != NULL); + const auto xpath{make_database(MU_TESTMAILDIR3)}; + g_assert (!xpath.empty()); - iter = run_and_get_iter (xpath, "abc"); + auto iter = run_and_get_iter (xpath, "abc"); g_assert (iter); g_assert (!mu_msg_iter_is_done(iter)); foreach_assert_tinfo_equal (iter, items, G_N_ELEMENTS (items)); - - g_free (xpath); mu_msg_iter_destroy (iter); } static void test_mu_threads_rogue (void) { - gchar *xpath; MuMsgIter *iter; tinfo *items; @@ -210,8 +194,8 @@ test_mu_threads_rogue (void) {"0:1", "cycle0.0.0@msg.id", "cycle0.0.0"} }; - xpath = fill_database (MU_TESTMAILDIR3); - g_assert (xpath != NULL); + const auto xpath{make_database (MU_TESTMAILDIR3)}; + g_assert_false (xpath.empty()); iter = run_and_get_iter (xpath, "def"); g_assert (iter); @@ -226,30 +210,20 @@ test_mu_threads_rogue (void) items = items2; foreach_assert_tinfo_equal (iter, items, G_N_ELEMENTS (items1)); - - g_free (xpath); mu_msg_iter_destroy (iter); } static MuMsgIter* query_testdir (const char *query, MuMsgFieldId sort_field, gboolean descending) { - MuMsgIter *iter; - gchar *xpath; - int flags; + const auto flags{descending ? Query::Flags::Descending : Query::Flags::None}; + const auto xpath{make_database(MU_TESTMAILDIR3)}; + g_assert_false (xpath.empty()); - flags = MU_QUERY_FLAG_NONE; - if (descending) - flags |= MU_QUERY_FLAG_DESCENDING; - - xpath = fill_database (MU_TESTMAILDIR3); - g_assert (xpath != NULL); - - iter = run_and_get_iter_full (xpath, query, sort_field, (MuQueryFlags)flags); + auto iter = run_and_get_iter_full (xpath, query, sort_field, flags); g_assert (iter != NULL); g_assert (!mu_msg_iter_is_done (iter)); - g_free (xpath); return iter; } @@ -442,6 +416,7 @@ main (int argc, char *argv[]) g_test_add_func ("/mu-query/test-mu-threads-01", test_mu_threads_01); g_test_add_func ("/mu-query/test-mu-threads-rogue", test_mu_threads_rogue); + g_test_add_func ("/mu-query/test-mu-threads-sort-1st-child-promotes-thread", test_mu_threads_sort_1st_child_promotes_thread); g_test_add_func ("/mu-query/test-mu-threads-sort-2nd-child-promotes-thread",