Skip to content

Commit 29116b7

Browse files
Adjust test expectations for XTEST feature
Update tests/unit/test_linux_backend.cpp to conditionally check for keyboard, mouse and XTEST fallback support when LIBVIRTUALHID_HAVE_XTEST is defined. Also reorder the output_reports expectation. This makes the fake Linux backend test adapt to builds with or without XTEST enabled so test expectations match configuration.
1 parent aa96274 commit 29116b7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/unit/test_linux_backend.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,16 @@ TEST_F(LinuxBackendTest, FakeLinuxBackendCreatesAllDeviceTypes) {
339339
const auto unavailable = lvh::detail::test::linux_backend_fake_unavailable_capabilities();
340340
EXPECT_FALSE(unavailable.supports_virtual_hid);
341341
EXPECT_FALSE(unavailable.supports_gamepad);
342+
EXPECT_FALSE(unavailable.supports_output_reports);
343+
#if defined(LIBVIRTUALHID_HAVE_XTEST)
344+
EXPECT_TRUE(unavailable.supports_keyboard);
345+
EXPECT_TRUE(unavailable.supports_mouse);
346+
EXPECT_TRUE(unavailable.supports_xtest_fallback);
347+
#else
342348
EXPECT_FALSE(unavailable.supports_keyboard);
343349
EXPECT_FALSE(unavailable.supports_mouse);
344-
EXPECT_FALSE(unavailable.supports_output_reports);
350+
EXPECT_FALSE(unavailable.supports_xtest_fallback);
351+
#endif
345352

346353
EXPECT_EQ(lvh::detail::test::linux_backend_gamepad_fake_open_failure().code(), lvh::ErrorCode::backend_unavailable);
347354
EXPECT_EQ(lvh::detail::test::linux_backend_gamepad_fake_create_failure().code(), lvh::ErrorCode::backend_failure);

0 commit comments

Comments
 (0)