platform: more logging for tests

This commit is contained in:
Pavel Šimerda
2013-07-26 14:25:47 +02:00
parent b38f76cdb4
commit ad5b0a8e67
3 changed files with 9 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ add_signal_full (const char *name, GCallback callback, int ifindex, const char *
void
accept_signal (SignalData *data)
{
debug ("Accepting signal '%s' ifindex %d ifname %s.", data->name, data->ifindex, data->ifname);
if (!data->received)
g_error ("Attemted to accept a non-received signal '%s'.", data->name);
@@ -55,7 +56,9 @@ run_command (const char *format, ...)
va_start (ap, format);
command = g_strdup_vprintf (format, ap);
debug ("Running command: %s", command);
g_assert (!system (command));
debug ("Command finished.");
g_free (command);
}

View File

@@ -9,6 +9,8 @@
#include "nm-fake-platform.h"
#include "nm-linux-platform.h"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
#define error(err) g_assert (nm_platform_get_error () == err)
#define no_error() error (NM_PLATFORM_ERROR_NONE)

View File

@@ -30,12 +30,15 @@ link_callback (NMPlatform *platform, int ifindex, NMPlatformLink *received, Sign
if (data->ifname && g_strcmp0 (data->ifname, nm_platform_link_get_name (ifindex)) != 0)
return;
if (data->loop)
if (data->loop) {
debug ("Quitting main loop.");
g_main_loop_quit (data->loop);
}
if (data->received)
g_error ("Received signal '%s' a second time.", data->name);
debug ("Recieved signal '%s' ifindex %d ifname '%s'.", data->name, ifindex, received->name);
data->received = TRUE;
/* Check the data */