nmtst: add parameter to nmtst_init to setup nm-logging

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-04-14 12:03:05 +02:00
parent 17c300b816
commit 86693d2378
3 changed files with 14 additions and 2 deletions

View file

@ -41,7 +41,7 @@ extern struct __nmtst_internal __nmtst_internal;
struct __nmtst_internal __nmtst_internal = { 0 };
inline static void
nmtst_init (int *argc, char ***argv)
nmtst_init (int *argc, char ***argv, const char *log_level, const char *log_domains)
{
g_assert (!__nmtst_internal.rand0);
@ -58,6 +58,14 @@ nmtst_init (int *argc, char ***argv)
#endif
__nmtst_internal.rand0 = g_rand_new_with_seed (0);
if (log_level || log_domains) {
gboolean success = FALSE;
#ifdef NM_LOGGING_H
success = nm_logging_setup (log_level, log_domains, NULL, NULL);
#endif
g_assert (success);
}
}
inline static GRand *

View file

@ -22,6 +22,10 @@
#ifndef NM_LOGGING_H
#define NM_LOGGING_H
#ifdef __NM_TEST_UTILS_H__
#error nm-test-utils.h must be included as last header
#endif
#include <glib.h>
#include <glib-object.h>

View file

@ -324,7 +324,7 @@ NMTST_DEFINE();
int
main (int argc, char **argv)
{
nmtst_init (&argc, &argv);
nmtst_init (&argc, &argv, NULL, NULL);
g_test_add_func ("/ip6-config/subtract", test_subtract);
g_test_add_func ("/ip6-config/compare-with-source", test_compare_with_source);