fix(audio): clear duplexMode on duplex setup failure; review cleanups

Address PR #114 review:
- failClosed now stores duplexMode=false so a failed reconfigure cannot
  leave the engine reporting duplex-active on a closed device.
- Drop the dead BigInteger initializers in the verify block.
- Move the applyDuplex locate-guard ahead of the source slice in the
  lifecycle test so marker drift fails with a clear message.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
OmikronApex
2026-07-17 14:03:56 +02:00
co-authored by Claude Fable 5
parent 78a3979a3a
commit cd93159751
2 changed files with 12 additions and 11 deletions
+3 -1
View File
@@ -16,10 +16,12 @@ const source = fs.readFileSync(
const start = source.indexOf('juce::String DeviceSetup::applyDuplex');
const end = source.indexOf('DeviceConfigResult DeviceSetup::applySplit', start);
// Fail with a clear message before any slicing if the function markers move —
// a bad slice would otherwise make every assertion below fail confusingly.
assert.ok(start >= 0 && end > start, 'could not locate applyDuplex in DeviceSetup.cpp');
const applyDuplex = source.slice(start, end);
test('duplex setup closes Windows ASIO before constructing its channel probe', () => {
assert.ok(start >= 0 && end > start, 'could not locate applyDuplex');
assert.match(
applyDuplex,
/#elif JUCE_WINDOWS\s+closeBeforeReconfigure = \(currentTypeName == "ASIO"\);/);