mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-25 19:50:06 +01:00
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:
parent
83e446225d
commit
800946a673
1 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue