fixes for Swift 6 and threading concerns

This commit is contained in:
2026-06-02 12:09:44 -07:00
parent 2fa4bfd45e
commit 6d3a0930a1
327 changed files with 1596 additions and 199 deletions
@@ -10,6 +10,7 @@ import Testing
// MARK: - OscSin Tests
@MainActor
@Suite("OscSin")
struct OscSinTests {
let blockSize: Int = 64
@@ -201,6 +202,7 @@ struct OscSinTests {
// MARK: - Impulse Tests
@MainActor
@Suite("Impulse")
struct ImpulseTests {
let blockSize: Int = 64
@@ -268,6 +270,7 @@ struct ImpulseTests {
// MARK: - WhiteNoise Tests
@MainActor
@Suite("WhiteNoise")
struct WhiteNoiseTests {
let blockSize: Int = 256
@@ -341,6 +344,7 @@ struct WhiteNoiseTests {
// MARK: - LFStepNoise Tests
@MainActor
@Suite("LFStepNoise")
struct LFStepNoiseTests {
// Use blockSize=100, sampleRate=100 → 1 second = 1 block, easy math
@@ -418,6 +422,7 @@ struct LFStepNoiseTests {
// MARK: - LFLineNoise Tests
@MainActor
@Suite("LFLineNoise")
struct LFLineNoiseTests {
let engine: SynthesisEngine
@@ -485,6 +490,7 @@ struct LFLineNoiseTests {
// MARK: - PinkNoise Tests
@MainActor
@Suite("PinkNoise")
struct PinkNoiseTests {
let blockSize: Int = 256
@@ -568,6 +574,7 @@ struct PinkNoiseTests {
// MARK: - BrownNoise Tests
@MainActor
@Suite("BrownNoise")
struct BrownNoiseTests {
let blockSize: Int = 256
@@ -662,6 +669,7 @@ struct BrownNoiseTests {
// MARK: - GrayNoise Tests
@MainActor
@Suite("GrayNoise")
struct GrayNoiseTests {
let blockSize: Int = 512
@@ -754,6 +762,7 @@ struct GrayNoiseTests {
// MARK: - ClipNoise Tests
@MainActor
@Suite("ClipNoise")
struct ClipNoiseTests {
let blockSize: Int = 512
@@ -830,6 +839,7 @@ struct ClipNoiseTests {
// MARK: - Dust Tests
@MainActor
@Suite("Dust")
struct DustTests {
// Use sampleRate=48000 and blockSize=512 to match the deterministic test setup.
@@ -941,6 +951,7 @@ struct DustTests {
// MARK: - Dust2 Tests
@MainActor
@Suite("Dust2")
struct Dust2Tests {
let blockSize: Int = 512
@@ -1051,6 +1062,7 @@ struct Dust2Tests {
// MARK: - FirstOrderSection Tests
@MainActor
@Suite("FirstOrderSection")
struct FirstOrderSectionTests {
let blockSize: Int = 8
@@ -1120,6 +1132,7 @@ struct FirstOrderSectionTests {
// MARK: - SecondOrderSection Tests
@MainActor
@Suite("SecondOrderSection")
struct SecondOrderSectionTests {
let blockSize: Int = 8
@@ -1176,6 +1189,7 @@ struct SecondOrderSectionTests {
// MARK: - RBJBandPass Tests
@MainActor
@Suite("RBJBandPass")
struct RBJBandPassTests {
let blockSize: Int = 512
@@ -1294,6 +1308,7 @@ struct RBJBandPassTests {
// MARK: - Envelope.valueAtTime Tests
@MainActor
@Suite("Envelope.valueAtTime")
struct EnvelopeValueAtTimeTests {
@@ -1423,6 +1438,7 @@ struct EnvelopeValueAtTimeTests {
// MARK: - EnvelopeGen Tests
@MainActor
@Suite("EnvelopeGen")
struct EnvelopeGenTests {
// blockSize=100, sampleRate=100 → 1s = 100 samples = 1 block, easy math
@@ -1720,6 +1736,7 @@ struct EnvelopeGenTests {
// MARK: - EnvelopeGen.Control Tests
@MainActor
@Suite("EnvelopeGen.Control")
struct EnvelopeGenControlTests {
// blockSize=100, sampleRate=100 → 1s = 100 samples = 1 block
@@ -1880,6 +1897,7 @@ struct EnvelopeGenControlTests {
// MARK: - EnvelopeGen Gate / releaseNode Tests
@MainActor
@Suite("EnvelopeGen.Gate")
struct EnvelopeGenGateTests {
// blockSize=100, sampleRate=100 → 1 sample = 0.01 s, 1 block = 1 s
@@ -2142,6 +2160,7 @@ struct EnvelopeGenGateTests {
// MARK: - EnvelopePoll Tests
@MainActor
@Suite("EnvelopePoll")
struct EnvelopePollTests {
// blockSize=100, sampleRate=100 → 1 s = 100 samples; simple arithmetic
@@ -2273,6 +2292,7 @@ struct EnvelopePollTests {
// MARK: - Runtime Envelope Swap Tests
@MainActor
@Suite("EnvelopeGen.SetEnvelope")
struct EnvelopeGenSetEnvelopeTests {
// blockSize=100, sampleRate=100 → 1 s = 100 samples per block
@@ -2427,6 +2447,7 @@ struct EnvelopeGenSetEnvelopeTests {
}
}
@MainActor
@Suite("EnvelopePoll.SetEnvelope")
struct EnvelopePollSetEnvelopeTests {
let engine: SynthesisEngine
@@ -2488,6 +2509,7 @@ struct EnvelopePollSetEnvelopeTests {
// MARK: - DelayLine Tests
@MainActor
@Suite("DelayLine")
struct DelayLineTests {
let blockSize: Int = 64
@@ -2602,6 +2624,7 @@ struct DelayLineTests {
// MARK: - DelayLineFeedback Tests
@MainActor
@Suite("DelayLineFeedback")
struct DelayLineFeedbackTests {
let blockSize: Int = 64
@@ -2819,6 +2842,7 @@ private final class ImpulseAudioGen: GeneratorBase, AudioGenerator {
// MARK: - Crackle Tests
@MainActor
@Suite("Crackle")
struct CrackleTests {
let blockSize: Int = 256
@@ -2918,6 +2942,7 @@ struct CrackleTests {
// MARK: - LFCurveNoise Tests
@MainActor
@Suite("LFCurveNoise")
struct LFCurveNoiseTests {
// blockSize=100, sampleRate=100: simple math for step counts.