         XCTAssertNotNil(outputStream.availablePhysicalFormatsMatchingCurrentNominalSampleRate(true))
         XCTAssertNotNil(outputStream.availablePhysicalFormatsMatchingCurrentNominalSampleRate(false))
 
-        let outVirtualFormat = try XCTUnwrap(outputStream.availableVirtualFormatsMatchingCurrentNominalSampleRate()?.first)
         outputStream.virtualFormat = nil
-        XCTAssertEqual(outputStream.virtualFormat, outVirtualFormat)
+        XCTAssertNotNil(outputStream.virtualFormat)
 
-        let outPhysicalFormat = try XCTUnwrap(outputStream.availablePhysicalFormatsMatchingCurrentNominalSampleRate()?.first)
         outputStream.physicalFormat = nil
-        XCTAssertEqual(outputStream.physicalFormat, outPhysicalFormat)
+        XCTAssertNotNil(outputStream.physicalFormat)
 
         let inputStream = try XCTUnwrap(inputStreams.first)
         XCTAssertTrue(inputStream.active)

import XCTest
@testable import AMCoreAudio

extension AudioStreamBasicDescription: Equatable {}

public func == (lhs: AudioStreamBasicDescription, rhs: AudioStreamBasicDescription) -> Bool {
    return
        lhs.mBitsPerChannel == rhs.mBitsPerChannel &&
        lhs.mBytesPerFrame == rhs.mBytesPerFrame &&
        lhs.mBytesPerPacket == rhs.mBytesPerPacket &&
        lhs.mChannelsPerFrame == rhs.mChannelsPerFrame &&
        lhs.mFormatFlags == rhs.mFormatFlags &&
        lhs.mFormatID == rhs.mFormatID &&
        lhs.mFramesPerPacket == rhs.mFramesPerPacket &&
        lhs.mReserved == rhs.mReserved
}

class AudioStreamTests: XCTestCase {
    func testProperties() throws {

        XCTAssertNotNil(inputStream.availablePhysicalFormatsMatchingCurrentNominalSampleRate(true))
        XCTAssertNotNil(inputStream.availablePhysicalFormatsMatchingCurrentNominalSampleRate(false))

        inputStream.virtualFormat = nil
        XCTAssertNotNil(inputStream.virtualFormat)

        inputStream.physicalFormat = nil
        XCTAssertNotNil(inputStream.physicalFormat)
    }

    // MARK: - Private Functions
