tests: Use CLOCK_MONOTONIC_FAST on FreeBSD

FreeBSD does not have CLOCK_MONOTONIC_RAW, instead use
CLOCK_MONOTONIC_FAST.  This test checks that libevdev_set_clock_id()
fails when called with CLOCK_MONOTONIC_[RAW,FAST].

Signed-off-by: Niclas Zeising <zeising@daemonic.se>
This commit is contained in:
Niclas Zeising 2020-08-10 23:16:08 +02:00
parent 83e446225d
commit 800946a673

View file

@ -559,6 +559,7 @@ START_TEST(test_set_clock_id)
{
struct uinput_device* uidev;
struct libevdev *dev;
int clockid;
int rc;
test_create_device(&uidev, &dev,
@ -577,7 +578,13 @@ START_TEST(test_set_clock_id)
rc = libevdev_set_clock_id(dev, CLOCK_MONOTONIC);
ck_assert_int_eq(rc, 0);
rc = libevdev_set_clock_id(dev, CLOCK_MONOTONIC_RAW);
#ifdef __FreeBSD__
clockid = CLOCK_MONOTONIC_FAST;
#else
clockid = CLOCK_MONOTONIC_RAW;
#endif
rc = libevdev_set_clock_id(dev, clockid);
ck_assert_int_eq(rc, -EINVAL);
uinput_device_free(uidev);