Commit 230dcd75 authored by Christian Kellner's avatar Christian Kellner

test: udev: copy domain id before removing it

When the domain is removed, its resources are freed, which includes
the domain id; cache the idstr so we can use it after the domain was
parent ddfe848c
......@@ -148,6 +148,7 @@ test_udev_basic (TestUdev *tt, gconstpointer user)
g_autoptr(BoltUdev) udev = NULL;
struct udev_device *dev = NULL;
g_autofree char *prop_name = NULL;
g_autofree char *idstr = NULL;
UEvent ev = { NULL, };
const char *filter[] = {"thunderbolt", NULL};
const char *syspath;
......@@ -190,7 +191,8 @@ test_udev_basic (TestUdev *tt, gconstpointer user)
g_assert_no_error (err);
/* remove a domain */
mock_sysfs_domain_remove (tt->sysfs, domain);
idstr = g_strdup (domain);
mock_sysfs_domain_remove (tt->sysfs, idstr);
n = wait_for_event (&ev, 2);
g_assert_false (ev.timedout);
......@@ -199,7 +201,7 @@ test_udev_basic (TestUdev *tt, gconstpointer user)
g_assert_nonnull (;
name = udev_device_get_sysname (;
g_assert_cmpstr (domain, ==, name);
g_assert_cmpstr (idstr, ==, name);
/* cleanup */
uevent_clear (&ev);
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