* unit-tests: small updates to tests

This commit is contained in:
Dirk-Jan C. Binnema
2010-09-26 15:23:17 +03:00
parent f4b0ad7a5d
commit 82176c8991
7 changed files with 21 additions and 32 deletions

View File

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** **
** This program is free software; you can redistribute it and/or modify it ** 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 ** under the terms of the GNU General Public License as published by the
@ -39,3 +39,10 @@ test_mu_common_get_random_tmpdir (void)
G_DIR_SEPARATOR, G_DIR_SEPARATOR,
(int)random()*getpid()*(int)time(NULL)); (int)random()*getpid()*(int)time(NULL));
} }
void
black_hole (void)
{
return; /* do nothing */
}

View File

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** **
** This program is free software; you can redistribute it and/or modify it ** 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 ** under the terms of the GNU General Public License as published by the
@ -31,6 +31,8 @@ G_BEGIN_DECLS
*/ */
char* test_mu_common_get_random_tmpdir (void); char* test_mu_common_get_random_tmpdir (void);
void black_hole (void);
G_END_DECLS G_END_DECLS
#endif /*__TEST_MU_COMMON_H__*/ #endif /*__TEST_MU_COMMON_H__*/

View File

@ -118,10 +118,6 @@ test_mu_maildir_mkmdir_03 (void)
} }
static void
shutup (void) {}
static gchar* static gchar*
copy_test_data (void) copy_test_data (void)
{ {
@ -252,7 +248,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
(GLogFunc)shutup, NULL); (GLogFunc)black_hole, NULL);
return g_test_run (); return g_test_run ();
} }

View File

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** **
** This program is free software; you can redistribute it and/or modify it ** 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 ** under the terms of the GNU General Public License as published by the
@ -125,13 +125,6 @@ test_mu_msg_str_prio_02 (void)
g_assert_cmpstr (mu_msg_str_prio(666), ==, NULL); g_assert_cmpstr (mu_msg_str_prio(666), ==, NULL);
} }
static void
shutup (void) {}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@ -158,7 +151,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
(GLogFunc)shutup, NULL); (GLogFunc)black_hole, NULL);
return g_test_run (); return g_test_run ();
} }

View File

@ -185,9 +185,6 @@ test_mu_msg_03 (void)
/* return FALSE; /\* don't abort *\/ */ /* return FALSE; /\* don't abort *\/ */
/* } */ /* } */
static void
shutup (void) {}
int int
@ -205,7 +202,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
(GLogFunc)shutup, NULL); (GLogFunc)black_hole, NULL);
return g_test_run (); return g_test_run ();
} }

View File

@ -105,7 +105,8 @@ test_mu_query_01 (void)
{ "html and contains", 1 }, { "html and contains", 1 },
{ "from:pepernoot", 0 }, { "from:pepernoot", 0 },
{ "foo:pepernoot", 0 }, { "foo:pepernoot", 0 },
{ "fünkÿ", 1 } { "fünkÿ", 1 },
// { "funky", 1 }
}; };
xpath = fill_database (); xpath = fill_database ();
g_assert (xpath != NULL); g_assert (xpath != NULL);
@ -225,7 +226,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,
(GLogFunc)shutup, NULL); (GLogFunc)black_hole, NULL);
return g_test_run (); return g_test_run ();
} }

View File

@ -1,5 +1,5 @@
/* /*
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** **
** This program is free software; you can redistribute it and/or modify it ** 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 ** under the terms of the GNU General Public License as published by the
@ -27,8 +27,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "test-mu-common.h"
#include "src/mu-util.h" #include "src/mu-util.h"
static void static void
@ -183,12 +182,6 @@ test_mu_util_str_from_strv_03 (void)
} }
static void
shutup (void) {}
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
@ -227,7 +220,7 @@ main (int argc, char *argv[])
g_log_set_handler (NULL, g_log_set_handler (NULL,
G_LOG_LEVEL_DEBUG| G_LOG_LEVEL_DEBUG|
G_LOG_LEVEL_MESSAGE| G_LOG_LEVEL_MESSAGE|
G_LOG_LEVEL_INFO, (GLogFunc)shutup, NULL); G_LOG_LEVEL_INFO, (GLogFunc)black_hole, NULL);
return g_test_run (); return g_test_run ();
} }