Expand description
Assertion helpers for truce-rack host integration tests.
Use these from host-side test suites that want to verify a
truce_rack_core::scanner::PluginScanner impl can scan a corpus, load each result,
activate it, and render a known input without NaN / clipping.
The helpers operate on Plugin<f32> instances by default;
a parallel _f64 variant for Plugin<f64> can be added when
the first VST3 / AU 64-bit consumer needs it.
§Example
ⓘ
use truce_rack_core::scanner::PluginScanner;
use truce_rack_test::{render_silence, assert_no_nans};
let scanner = MyScanner::new();
for info in scanner.scan()? {
let mut plugin = scanner.load(&info)?;
let rendered = render_silence(&mut plugin, 48_000.0, 1024)?;
assert_no_nans(&rendered);
}Structs§
- Rendered
- Rendered audio block — what every helper hands back so callers can run their own assertions.
Functions§
- assert_
no_ nans - Assert that no sample in
renderedis NaN. Panics if any is. - assert_
peak_ below - Assert that the peak sample is at or below
bound. - assert_
state_ round_ trip - Round-trip the plugin’s saved state: dump → load → dump, and assert the second dump equals the first. Catches non-deterministic state encoding.
- render
- Render
num_framesof a generated input throughplugin.generatoris called per(channel, frame)and returns the input sample at that position. - render_
silence - Render
num_framesof silence throughpluginatsample_rate. Useful for “plugin doesn’t crash on empty input” smoke tests.