     }
 
     func testTransientNodes() {
+        let engine = AKEngine()
         let osc = AKOscillator()
         func exampleStart() {
             let env = AKAmplitudeEnvelope(osc)


    func testDynamicOutput() {

        duration = 2.0

        let osc1 = AKOscillator()
        osc1.start()
        engine.output = osc1

        AKStartSegmentedTest(duration: 1.0)

        let osc2 = AKOscillator(frequency: 880)
        osc2.start()
        engine.output = osc2

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()

    }

    func testDynamicConnection() {

        duration = 2.0

        let osc = AKOscillator()
        let mixer = AKMixer(osc)
        engine.output = mixer

        osc.start()

        AKStartSegmentedTest(duration: 1.0)

        let osc2 = AKOscillator(frequency: 880)
        osc2.start()
        mixer.addInput(osc2)

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()
    }

    func testDynamicConnection2() {

        duration = 2.0

        let osc = AKOscillator()
        let mixer = AKMixer(osc)

        engine.output = mixer
        osc.start()

        AKStartSegmentedTest(duration: 1.0)

        let osc2 = AKOscillator(frequency: 880)
        let verb = AKCostelloReverb(osc2)
        osc2.start()
        mixer.addInput(verb)

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()
    }

    func testDynamicConnection3() {

        duration = 3.0

        let osc = AKOscillator()
        let mixer = AKMixer(osc)
        engine.output = mixer

        osc.start()

        AKStartSegmentedTest(duration: 1.0)

        let osc2 = AKOscillator(frequency: 880)
        osc2.start()
        mixer.addInput(osc2)

        AKAppendSegmentedTest(duration: 1.0)

        mixer.removeInput(osc2)

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()
    }

    func testDisconnect() {

        duration = 2.0

        let osc = AKOscillator()
        let mixer = AKMixer(osc)
        osc.start()
        engine.output = mixer

        AKStartSegmentedTest(duration: 1.0)

        mixer.removeInput(osc)

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()

    }

    func testNodeDetach() {

        duration = 2.0

        let osc = AKOscillator()
        let mixer = AKMixer(osc)
        engine.output = mixer
        osc.start()

        AKStartSegmentedTest(duration: 1.0)

        osc.detach()

        AKAppendSegmentedTest(duration: 1.0)

        AKFinishSegmentedTest()

    }

    func testTwoEngines() {

        let engine2 = AKEngine()

        let osc = AKOscillator()

// Copyright AudioKit. All Rights Reserved. Revision History at http://github.com/AudioKit/AudioKit/
@testable import AudioKit
import AVFoundation
import CAudioKit
import XCTest

class AKNodeTests: XCTestCase {

    let osc = AKOscillator()

    func testNodeBasic() {
        let engine = AKEngine()
        let osc = AKOscillator()
        XCTAssertNotNil(osc.avAudioUnit)
        osc.start()
        engine.output = osc
        let audio = engine.startTest(totalDuration: 0.1)
        audio.append(engine.render(duration: 0.1))
        testMD5(audio)
    }

    func testNodeConnection() {
        let engine = AKEngine()
        let osc = AKOscillator()
        osc.start()
        let verb = AKCostelloReverb(osc)
        engine.output = verb
        let audio = engine.startTest(totalDuration: 0.1)
        audio.append(engine.render(duration: 0.1))
        testMD5(audio)
    }

    func testRedundantConnection() {
