Commit e9d38b3f authored by Simon McVittie's avatar Simon McVittie
Browse files

test/dbus-daemon: Don't leak method call messages if we skip tests


Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103600
parent 173f694b
......@@ -1296,8 +1296,7 @@ static void
test_get_invalid_path (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
"/", DBUS_INTERFACE_PROPERTIES, "Get");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1306,6 +1305,9 @@ test_get_invalid_path (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS, "/",
DBUS_INTERFACE_PROPERTIES, "Get");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1342,8 +1344,7 @@ static void
test_get_invalid_iface (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = "com.example.Nope";
......@@ -1352,6 +1353,9 @@ test_get_invalid_iface (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1387,8 +1391,7 @@ static void
test_get_invalid (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1397,6 +1400,9 @@ test_get_invalid (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1432,8 +1438,7 @@ static void
test_get_all_invalid_iface (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "GetAll");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = "com.example.Nope";
......@@ -1441,6 +1446,9 @@ test_get_all_invalid_iface (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "GetAll");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1475,8 +1483,7 @@ static void
test_get_all_invalid_path (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
"/", DBUS_INTERFACE_PROPERTIES, "GetAll");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1484,6 +1491,9 @@ test_get_all_invalid_path (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
"/", DBUS_INTERFACE_PROPERTIES, "GetAll");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1519,8 +1529,7 @@ static void
test_set_invalid_iface (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = "com.example.Nope";
......@@ -1532,6 +1541,9 @@ test_set_invalid_iface (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1575,8 +1587,7 @@ static void
test_set_invalid_path (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
"/", DBUS_INTERFACE_PROPERTIES, "Set");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1588,6 +1599,9 @@ test_set_invalid_path (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
"/", DBUS_INTERFACE_PROPERTIES, "Set");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1631,8 +1645,7 @@ static void
test_set_invalid (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1644,6 +1657,9 @@ test_set_invalid (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1687,8 +1703,7 @@ static void
test_set (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusError error = DBUS_ERROR_INIT;
const char *iface = DBUS_INTERFACE_DBUS;
......@@ -1700,6 +1715,9 @@ test_set (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Set");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1781,8 +1799,7 @@ static void
test_features (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusMessageIter args_iter;
DBusMessageIter var_iter;
......@@ -1792,6 +1809,9 @@ test_features (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1886,8 +1906,7 @@ static void
test_interfaces (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusMessageIter args_iter;
DBusMessageIter var_iter;
......@@ -1897,6 +1916,9 @@ test_interfaces (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "Get");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......@@ -1938,8 +1960,7 @@ static void
test_get_all (Fixture *f,
gconstpointer context)
{
DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "GetAll");
DBusMessage *m = NULL;
DBusPendingCall *pc = NULL;
DBusMessageIter args_iter;
DBusMessageIter arr_iter;
......@@ -1952,6 +1973,9 @@ test_get_all (Fixture *f,
if (f->skip)
return;
m = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS, DBUS_INTERFACE_PROPERTIES, "GetAll");
if (m == NULL ||
!dbus_message_append_args (m,
DBUS_TYPE_STRING, &iface,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment