From 6e2c4138feb625d904539eb1d28e9c74ab8a4e80 Mon Sep 17 00:00:00 2001 From: BANANASJIM Date: Wed, 3 Jun 2026 17:29:09 -0700 Subject: [PATCH] test(vader5): pin block_kernel_drivers to xpad only (regression #355) Assert the shipped devices/flydigi/vader5.toml blocks only xpad and never hid_generic/usbhid. The inline-TOML install tests cannot catch a value regression in the real device file; this pins the #355 fix. --- src/config/device.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/config/device.zig b/src/config/device.zig index 1b52bc4..ca65b24 100644 --- a/src/config/device.zig +++ b/src/config/device.zig @@ -641,6 +641,23 @@ test "device: vader5 IF1 is claimed via libusb (vendor transport)" { try std.testing.expect(init_cfg.enable != null); } +test "device: vader5 blocks only xpad (regression #355)" { + const allocator = std.testing.allocator; + const result = try parseFile(allocator, "devices/flydigi/vader5.toml"); + defer result.deinit(); + + // Blocking hid_generic/usbhid removed the hidraw node that discovery needs; + // padctl self-detaches the kernel HID driver at libusb claim, so only xpad + // must be blocked. + const blocked = result.value.device.block_kernel_drivers orelse return error.MissingBlockList; + try std.testing.expectEqual(@as(usize, 1), blocked.len); + try std.testing.expectEqualStrings("xpad", blocked[0]); + for (blocked) |drv| { + try std.testing.expect(!std.mem.eql(u8, drv, "hid_generic")); + try std.testing.expect(!std.mem.eql(u8, drv, "usbhid")); + } +} + test "device: usesLibusb true for vendor/suppress, false for hid-only" { const allocator = std.testing.allocator;