From: Yu Watanabe Date: Wed, 31 Oct 2018 05:47:50 +0000 (+0900) Subject: test: check returned value of sd_device_get_usec_since_initialized() X-Git-Tag: v240~403^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5db6debcdc4de4381a878bd832a57041d86c41e;p=thirdparty%2Fsystemd.git test: check returned value of sd_device_get_usec_since_initialized() --- diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index e523206b61a..1dda6625d20 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -53,7 +53,7 @@ static void test_sd_device_basic(void) { assert_se(i >= 0); if (i > 0) { r = sd_device_get_usec_since_initialized(d, &usec); - assert_se(r >= 0 || r == -ENODATA); + assert_se((r >= 0 && usec > 0) || r == -ENODATA); } r = sd_device_get_sysattr_value(d, "name_assign_type", &val);