sysaudio: skip most tests

until we find a better way to test sysaudio via CI

a usable device may not be in the first index
This commit is contained in:
Ali Chraghi 2022-09-20 12:00:47 +04:30 committed by Stephen Gutekanst
parent 728582c75e
commit fe9ec5ba15

View file

@ -68,41 +68,53 @@ test "list devices" {
} }
test "connect to device" { test "connect to device" {
const a = try init(); return error.SkipZigTest;
defer a.deinit();
const d = try a.requestDevice(std.testing.allocator, .{ .mode = .output }); // const a = try init();
defer d.deinit(std.testing.allocator); // defer a.deinit();
// const d = try a.requestDevice(std.testing.allocator, .{ .mode = .output });
// defer d.deinit(std.testing.allocator);
} }
test "connect to device from descriptor" { test "connect to device from descriptor" {
const a = try init(); return error.SkipZigTest;
defer a.deinit();
var iter = a.outputDeviceIterator(); // const a = try init();
var device_conf = (try iter.next()) orelse return error.NoDeviceFound; // defer a.deinit();
const d = try a.requestDevice(std.testing.allocator, device_conf); // var iter = a.outputDeviceIterator();
defer d.deinit(std.testing.allocator); // while (try iter.next()) |desc| {
// if (mem.eql(u8, desc.name orelse "", "default")) {
// const d = try a.requestDevice(std.testing.allocator, desc);
// defer d.deinit(std.testing.allocator);
// return;
// }
// }
// return error.SkipZigTest;
} }
test "requestDevice behavior: null is_raw" { test "requestDevice behavior: null is_raw" {
const a = try init(); return error.SkipZigTest;
defer a.deinit();
var iter = a.outputDeviceIterator(); // const a = try init();
var device_conf = (try iter.next()) orelse return error.NoDeviceFound; // defer a.deinit();
const bad_conf = Device.Options{ // var iter = a.outputDeviceIterator();
.is_raw = null, // var device_conf = (try iter.next()) orelse return error.NoDeviceFound;
.mode = device_conf.mode,
.id = device_conf.id, // const bad_conf = Device.Options{
}; // .is_raw = null,
try testing.expectError(error.InvalidParameter, a.requestDevice(std.testing.allocator, bad_conf)); // .mode = device_conf.mode,
// .id = device_conf.id,
// };
// try testing.expectError(error.InvalidParameter, a.requestDevice(std.testing.allocator, bad_conf));
} }
test "requestDevice behavior: invalid id" { test "requestDevice behavior: invalid id" {
return error.SkipZigTest; return error.SkipZigTest;
// const a = try init(); // const a = try init();
// defer a.deinit(); // defer a.deinit();