Skip to main content

Crate truce_rack_test

Crate truce_rack_test 

Source
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 rendered is 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_frames of a generated input through plugin. generator is called per (channel, frame) and returns the input sample at that position.
render_silence
Render num_frames of silence through plugin at sample_rate. Useful for “plugin doesn’t crash on empty input” smoke tests.