const char *s, *syspath = userdata;
ASSERT_OK(sd_device_get_syspath(d, &s));
- ASSERT_TRUE(streq(s, syspath));
+ ASSERT_STREQ(s, syspath);
return sd_event_exit(sd_device_monitor_get_event(m), 100);
}
TEST(sd_device_monitor_is_running) {
_cleanup_(sd_device_monitor_unrefp) sd_device_monitor *m = NULL;
- ASSERT_EQ(sd_device_monitor_is_running(NULL), 0);
+ ASSERT_OK_ZERO(sd_device_monitor_is_running(NULL));
ASSERT_OK(device_monitor_new_full(&m, MONITOR_GROUP_NONE, -1));
- ASSERT_EQ(sd_device_monitor_is_running(m), 0);
+ ASSERT_OK_ZERO(sd_device_monitor_is_running(m));
ASSERT_OK(sd_device_monitor_start(m, NULL, NULL));
- ASSERT_EQ(sd_device_monitor_is_running(m), 1);
+ ASSERT_OK_POSITIVE(sd_device_monitor_is_running(m));
ASSERT_OK(sd_device_monitor_stop(m));
- ASSERT_EQ(sd_device_monitor_is_running(m), 0);
+ ASSERT_OK_ZERO(sd_device_monitor_is_running(m));
}
TEST(sd_device_monitor_start_stop) {
r = fd_wait_for_event(fd, POLLIN, 10 * USEC_PER_SEC);
if (r == -EINTR)
continue;
- ASSERT_GT(r, 0);
+ ASSERT_OK_POSITIVE(r);
break;
}
_cleanup_(sd_device_unrefp) sd_device *dev = NULL;
- ASSERT_GT(sd_device_monitor_receive(monitor_client, &dev), 0);
+ ASSERT_OK_POSITIVE(sd_device_monitor_receive(monitor_client, &dev));
const char *s;
ASSERT_OK(sd_device_get_syspath(dev, &s));
- ASSERT_TRUE(streq(s, syspath));
+ ASSERT_STREQ(s, syspath);
}
static int intro(void) {