test: pin JUCE WASAPI exclusive device-type name (#90)

The shared player bundle (feedBack#824) detects exclusive-style output
by string-matching getCurrentDevice().outputType. The name is hardcoded
in vendored JUCE; a JUCE upgrade renaming it would silently disable the
feedpak-under-exclusive routing. Fail the build instead.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
OmikronApex
2026-07-09 22:18:04 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent b2be91808c
commit 91c4e0037f
+30
View File
@@ -0,0 +1,30 @@
// Pins the JUCE WASAPI device-type names the shared player bundle keys on.
//
// The renderer decides "output is exclusive-style" by string-matching
// getCurrentDevice().outputType against 'Windows Audio (Exclusive Mode)'
// (see feedBack/static/app.js, _isExclusiveOutputType). That name is a
// hardcoded, unlocalised string inside the vendored JUCE. If a JUCE upgrade
// renames it, the feedpak-under-exclusive routing silently stops engaging —
// this test turns that into a build-time failure instead.
const { test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const WASAPI_CPP = path.join(
__dirname, '..', 'JUCE', 'modules', 'juce_audio_devices', 'native',
'juce_WASAPI_windows.cpp');
test('vendored JUCE still names the exclusive WASAPI type "Windows Audio (Exclusive Mode)"', () => {
const src = fs.readFileSync(WASAPI_CPP, 'utf8');
assert.ok(
src.includes('return "Windows Audio (Exclusive Mode)"'),
'JUCE WASAPI exclusive type name changed — update _isExclusiveOutputType in feedBack/static/app.js');
// The shared-mode low-latency type must remain distinct: the renderer
// predicate relies on exact equality so this name must NOT collapse into
// the exclusive one.
assert.ok(
src.includes('"Windows Audio (Low Latency Mode)"'),
'JUCE WASAPI low-latency type name changed — re-verify the exclusive predicate');
});