Skip to main content

rodecaster_protocol/names/
test.rs

1//! [`TestParam`]: the singleton `TEST`-node parameter family.
2
3// The two properties the TEST node carries (confirmed from capture, firmware
4// 1.7.3). Diagnostic / factory-test channels: writing `AllLedsWhite` turns
5// every front-panel LED white for hardware inspection; `ToneGeneration`
6// selects an internal test tone.
7wire_param_enum! {
8    /// A device-diagnostic parameter: the two flat properties on the
9    /// singleton `TEST` node. `AllLedsWhite` is a factory-test command
10    /// (writing `Int(1)` engages the all-LEDs-white mode; verified on Duo
11    /// fw 1.7.3, write persists across refresh); `ToneGeneration` selects
12    /// an internal test-tone source for audio-path verification. Both wire
13    /// types are `Int`; the crate types the property name only.
14    ///
15    /// Firmware wire name preserves the capitalized "LEDS" (`allLEDSWhite`).
16    TestParam {
17    AllLedsWhite => "allLEDSWhite",
18    ToneGeneration => "toneGeneration",
19    }
20}
21
22#[cfg(test)]
23mod tests {
24    use super::*;
25
26    #[test]
27    fn test_param_round_trips() {
28        for p in [TestParam::AllLedsWhite, TestParam::ToneGeneration] {
29            assert_eq!(TestParam::from_name(p.as_str()), p);
30            assert!(p.is_known());
31        }
32    }
33
34    #[test]
35    fn test_param_preserves_leds_capitalization() {
36        assert_eq!(TestParam::AllLedsWhite.as_str(), "allLEDSWhite");
37    }
38}