From 744416beb4e3f9cd504bbbd5b6ec17b8130f1b69 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Fri, 2 Feb 2024 17:28:11 -0700 Subject: [PATCH] Fix event_device grab test --- tests/liboxide/test_Event_Device.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/liboxide/test_Event_Device.cpp b/tests/liboxide/test_Event_Device.cpp index 45c998d70..eb8daf7fd 100644 --- a/tests/liboxide/test_Event_Device.cpp +++ b/tests/liboxide/test_Event_Device.cpp @@ -19,12 +19,13 @@ void test_Event_Device::test_create_device(){ void test_Event_Device::test_event_device(){ Oxide::event_device event0("/dev/input/event0", O_RDWR); QCOMPARE(event0.device, "/dev/input/event0"); - QVERIFY(!event0.locked); - event0.lock(); - QVERIFY(event0.locked); - event0.unlock(); - QVERIFY(!event0.locked); QVERIFY(event0.fd > 0); + QVERIFY(!event0.locked); + if(event0.lock() != EBUSY){ + QVERIFY(event0.locked); + event0.unlock(); + QVERIFY(!event0.locked); + } event0.close(); QCOMPARE(event0.fd, 0); }