Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* test cases: update for mu-msg / mu-runtime change

  • Loading branch information...
commit 52972f1ec9efa553e6c6f8ba64b78536eb336ff1 1 parent 9916bb3
@djcb authored
View
35 src/tests/test-mu-cmd.c
@@ -314,21 +314,26 @@ test_mu_extract_03 (void)
int
main (int argc, char *argv[])
{
- g_test_init (&argc, &argv, NULL);
+ int rv;
+ g_test_init (&argc, &argv, NULL);
- g_test_add_func ("/mu-cmd/test-mu-index", test_mu_index);
- g_test_add_func ("/mu-cmd/test-mu-find-01", test_mu_find_01);
- g_test_add_func ("/mu-cmd/test-mu-find-02", test_mu_find_02);
- g_test_add_func ("/mu-cmd/test-mu-find-03", test_mu_find_03);
- g_test_add_func ("/mu-cmd/test-mu-find-04", test_mu_find_04);
- g_test_add_func ("/mu-cmd/test-mu-extract-01", test_mu_extract_01);
- g_test_add_func ("/mu-cmd/test-mu-extract-02", test_mu_extract_02);
- g_test_add_func ("/mu-cmd/test-mu-extract-03", test_mu_extract_03);
-
- g_log_set_handler (NULL,
- G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
- (GLogFunc)black_hole, NULL);
-
- return g_test_run ();
+ g_test_add_func ("/mu-cmd/test-mu-index", test_mu_index);
+ g_test_add_func ("/mu-cmd/test-mu-find-01", test_mu_find_01);
+ g_test_add_func ("/mu-cmd/test-mu-find-02", test_mu_find_02);
+ g_test_add_func ("/mu-cmd/test-mu-find-03", test_mu_find_03);
+ g_test_add_func ("/mu-cmd/test-mu-find-04", test_mu_find_04);
+ g_test_add_func ("/mu-cmd/test-mu-extract-01", test_mu_extract_01);
+ g_test_add_func ("/mu-cmd/test-mu-extract-02", test_mu_extract_02);
+ g_test_add_func ("/mu-cmd/test-mu-extract-03", test_mu_extract_03);
+
+ g_log_set_handler (NULL,
+ G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
+ (GLogFunc)black_hole, NULL);
+
+ mu_msg_gmime_init ();
+ rv = g_test_run ();
+ mu_msg_gmime_uninit();
+
+ return rv;
}
View
40 src/tests/test-mu-msg.c
@@ -228,21 +228,27 @@ test_mu_msg_04 (void)
int
main (int argc, char *argv[])
{
- g_test_init (&argc, &argv, NULL);
-
- /* mu_msg_str_date */
- 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_log_set_handler (NULL,
- G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
- (GLogFunc)black_hole, NULL);
-
- return g_test_run ();
+ int rv;
+ g_test_init (&argc, &argv, NULL);
+
+ /* mu_msg_str_date */
+ 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_log_set_handler (NULL,
+ G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
+ (GLogFunc)black_hole, NULL);
+
+ mu_msg_gmime_init ();
+ rv = g_test_run ();
+ mu_msg_gmime_uninit ();
+
+ return rv;
+
}
View
12 src/tests/test-mu-query.c
@@ -107,12 +107,15 @@ test_mu_query_01 (void)
{ "funky", 1 },
{ "fünkÿ", 1 },
};
+
+
xpath = fill_database ();
g_assert (xpath != NULL);
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);
}
@@ -233,8 +236,9 @@ test_mu_query_05 (void)
int
main (int argc, char *argv[])
{
- g_test_init (&argc, &argv, NULL);
+ int rv;
+ g_test_init (&argc, &argv, NULL);
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);
g_test_add_func ("/mu-query/test-mu-query-03", test_mu_query_03);
@@ -244,7 +248,11 @@ main (int argc, char *argv[])
g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
(GLogFunc)black_hole, NULL);
+
+ mu_msg_gmime_init ();
+ rv = g_test_run ();
+ mu_msg_gmime_uninit ();
- return g_test_run ();
+ return rv;
}
Please sign in to comment.
Something went wrong with that request. Please try again.