Testing
Two suites, one command.
zig build test --summary all
Build Summary: 9/9 steps succeeded; 35/35 tests passed
Unit tests
src/tests.zig, 35 tests, run with zig build test-unit. No artifact and no
host required. They cover:
- dB and linear conversion in both directions, including the round trip and the -80 dB floor.
linearInterpolateandclampat endpoints and midpoints.AudioBufferinit, zeroing, and clear.GainProcessordB conversion, normalized mapping, clamping, and thatprocessramps rather than jumping.SimpleRampinstant mode, arrival at target, and restart onsetTarget.normalizeanddenormalize, including the degenerate zero-width range.AtomicParam: the 64-byte size assertion, clamping, denormalization, instant mode, monotone non-overshooting smoothing,snap, andsetSmoothingMswith non-positive input.ParamStore: index allocation, round trip, out-of-range tolerance,tickAll, andsnapAll.
VST3 ABI integration harness
examples/danzig-test, run with zig build test-integration. This one links
the built DanzigGain plugin and calls into it the way a host does.
danzig integration harness
VST3 module entry
ok bundleEntry accepts the load and reports success
VST3 factory ABI
ok GetPluginFactory returns a non-null object
ok countClasses reports one exported class
...
ok createInstance accepts the advertised class id
ok the object hands back IAudioProcessor
ok the object hands back IEditController
...
ok setupProcessing accepts 48 kHz
ok process returns kResultOk
ok the default 0 dB setting passes DC through at unity
ok bypass passes the input through untouched
ok releasing the last reference drops the count to zero
danzig static library
ok AudioBuffer reports its geometry
ok dBToLinear(0 dB) is unity
ok dBToLinear(+6 dB) is ~1.995
ok ParamStore reaches +48 dB at full scale
all integration checks passed
About fifty checks run in all, covering the factory, createInstance, the
interface queries, the bus and parameter reports, and a full
setupProcessing/setActive/process pass whose output is checked against the
DSP. The harness declares its own copy of the IPluginFactory vtable rather than
importing the plugin's Zig types. It reads the first word of the returned
pointer as a vtable pointer and calls through the C function pointers. If the
object layout ever stops matching what a host expects, the dereference fails
here before it fails in a DAW.
It returns a non-zero exit code on failure, so zig build test fails with it.
CI
.github/workflows/ci.yml runs zig build and zig build test on macos-15
against 0.14.1, 0.15.2, and 0.16.0. The runner is pinned to macos-15 rather
than macos-latest, because macos-latest now ships an Xcode whose SDK Zig
0.14.1 cannot link against.