Verify playback DSP command arguments and output boundaries

This commit is contained in:
omar committed 2026-11-28 03:48:22 +03:00
1 parent da827f1f93
commit 79eacbec6a
3 files changed
+20

No files matched your search

+16
View File
@@ -484,6 +484,22 @@ fn client_info_requires_explicit_client_identity() {
assert_eq!(reply["error"]["code"],"not_connected","{reply}"); core.shutdown();
}
#[test]
fn playback_dsp_stdio_requires_an_explicit_boolean_agc() {
let dir = TempDir::new("playback-dsp-args");
let mut core = Core::start(&dir.0);
for args in [json!({}), json!({"agc": null}), json!({"agc": 1}), json!({"agc": "false"}), json!({"agc": true, "gain": 1})] {
let (reply, _) = core.request("invalid-dsp", "set_playback_dsp", args);
assert_eq!(reply["error"]["code"], "bad_request", "{reply}");
}
for enabled in [true, false] {
let (reply, _) = core.request("valid-dsp", "set_playback_dsp", json!({"agc": enabled}));
assert_eq!(reply["ok"], true, "{reply}");
assert_eq!(reply["result"]["agc"], enabled);
}
core.shutdown();
}
#[test]
fn audio_flag_updates_are_partial_and_reject_explicit_null() {
let dir = TempDir::new("audio-flag-args");