#include <gio/gio.h>

int main()
{
	g_type_init ();
	GDBusMessage *message = g_dbus_message_new ();
	g_dbus_message_set_message_type (message, G_DBUS_MESSAGE_TYPE_METHOD_RETURN);
	g_dbus_message_set_body (message, g_variant_new ("()"));
	g_debug ("signature='%s', body=%p",
		 g_dbus_message_get_signature (message),
		 g_dbus_message_get_body (message));
	gsize size = 0;
	GError *error = NULL;
	guchar *data = g_dbus_message_to_blob (message, &size, 0,&error);
	g_object_unref (message);
	if (data == NULL) {
		g_debug ("%s", error->message);
		g_error_free (error);
		return 1;
	}
	message = g_dbus_message_new_from_blob (data, size, 0, NULL);
	g_free (data);
	g_debug ("signature='%s', body=%p",
		 g_dbus_message_get_signature (message),
		 g_dbus_message_get_body (message));
	data = g_dbus_message_to_blob (message, &size, 0,&error);
	g_object_unref (message);
	if (data == NULL) {
		g_debug ("%s", error->message);
		g_error_free (error);
		return 1;
	}
	return 0;
}
