#![allow(clippy::too_many_lines)]

use audiotoolbox::{generated_c_types, *};
macro_rules! touch_root { ($($name:ident),+ $(,)?) => { $(let _ = std::mem::size_of::<$name>();)+ }; }
macro_rules! touch_generated { ($($name:ident),+ $(,)?) => { $(let _ = std::mem::size_of::<generated_c_types::$name>();)+ }; }
#[test]
fn exhaustive_symbol_surface_smoke_test() {
    // root symbols
    touch_root!(
        AVAudioSequencerInfoDictionaryKey,
        AVAudioTime,
        AVMusicTimeStamp,
        AUValue,
        AudioUnitParameter,
        AVAudioPCMBuffer,
        AudioUnitRenderActionFlags,
        AVAudioUnit
    );
    touch_root!(
        AVMusicEvent,
        MusicEventIterator,
        AVSpeechSynthesizer,
        AVSpeechUtterance,
        AudioFileMarker,
        AUEventSampleTime,
        AVAudioFramePosition,
        AUParameter
    );
    touch_root!(
        AVAudioBuffer,
        AVAudioUnitEffect,
        AVMusicTrack,
        AudioFileRegion,
        AUParameterAddress,
        AUParameterNode,
        AudioFileMarkerList,
        AVAudioSessionPolarPattern
    );
    touch_root!(
        AudioUnitParameterOptions,
        AUAudioUnitPreset,
        AVAudioConnectionPoint,
        AVAudioPlayer,
        AVAudioRecorder,
        AVSpeechSynthesisMarker,
        AVAudio3DPoint,
        AUParameterObserverToken
    );
    touch_root!(
        AURenderEvent,
        AVAudioSessionOrientation,
        AURenderCallback,
        AUAudioUnitBus,
        AVAudioUnitComponent,
        MIDIEventList,
        AVAudio3DVector,
        MIDIEndpointRef
    );
    touch_root!(
        MusicDeviceGroupID,
        AudioUnitPropertyListenerProc,
        AUParameterGroup,
        AVAudioUnitTimeEffect,
        AVMIDIChannelEvent,
        AVSpeechSynthesisVoice,
        AVAudio3DAngularOrientation,
        AVAudio3DVectorOrientation
    );
    touch_root!(
        MusicDeviceNoteParams,
        AVAudioPacketCount,
        AVAudioPlayerNodeCompletionCallbackType,
        MusicDeviceInstrumentID,
        AUAudioUnitBusArray,
        AVAudioIONode,
        AVAudioMixerNode,
        AVSpeechSynthesisProviderRequest
    );
    touch_root!(
        AVSpeechSynthesisProviderVoice,
        AUNodeInteraction,
        AURenderCallbackStruct,
        AudioUnitNodeConnection,
        AudioUnitParameterEvent,
        AUAudioUnitBusType,
        AURenderEventType,
        AVAudioSessionCategoryOptions
    );
    touch_root!(
        MIDIChannelNumber,
        NoteInstanceID,
        AUMIDIEventListBlock,
        AVAudioNodeCompletionHandler,
        AVAudioPlayerNodeCompletionHandler,
        AUParameterTree,
        AVAudioSequencer,
        AVAudioUnitMIDIInstrument
    );
    touch_root!(
        AUNodeRenderCallback,
        AVAudioVoiceProcessingOtherAudioDuckingConfiguration,
        AudioFile_SMPTE_Time,
        AudioUnitProperty,
        MusicEventUserData,
        NoteParamsControlValue,
        AUAudioUnitStatus,
        AVAudioSessionLocation
    );
    touch_root!(
        AVAudioStereoOrientation,
        AUMIDIOutputEventBlock,
        AURenderPullInputBlock,
        AVAudioConverter,
        AVAudioSessionCapability,
        AVAudioUnitComponentManager,
        AVAudioUnitEQ,
        AVAudioUnitReverb
    );
    touch_root!(
        AUMIDIEvent,
        AUMIDIEventList,
        AUParameterAutomationEvent,
        AUParameterEvent,
        AUPresetEvent,
        AURecordedParameterEvent,
        AURenderEventHeader,
        AVAudioConverterPrimeInfo
    );
    touch_root!(
        AudioBalanceFade,
        AudioBytePacketTranslation,
        AudioConverterPrimeInfo,
        AudioFilePacketTableInfo,
        AudioFileRegionList,
        AudioFileTypeAndFormatID,
        AudioFormatInfo,
        AudioFramePacketTranslation
    );
    touch_root!(
        AudioIndependentPacketTranslation,
        AudioPacketDependencyInfoTranslation,
        AudioPacketRangeByteCountTranslation,
        AudioPacketRollDistanceTranslation,
        AudioPanningInfo,
        ExtendedAudioFormatInfo,
        ExtendedControlEvent,
        ExtendedNoteOnEvent
    );
    touch_root!(
        MIDIChannelMessage,
        MIDIMetaEvent,
        MIDIRawData,
        MusicDeviceStdNoteParams,
        ParameterEvent,
        AUAudioObjectID,
        AUParameterAutomationEventType,
        AVAudioApplicationMicrophoneInjectionPermission
    );
    touch_root!(
        AVAudioEngineManualRenderingMode,
        AVAudioEngineManualRenderingStatus,
        AVAudioPlayerNodeBufferOptions,
        AVAudioSessionMicrophoneInjectionMode,
        AVAudioSessionSetActiveOptions,
        AVAudioUnitReverbPreset,
        AVMIDIControlChangeMessageType,
        AVMIDIMetaEventType
    );
    touch_root!(
        AVMusicSequenceLoadOptions,
        AVSpeechBoundary,
        AVSpeechSynthesisMarkerMark,
        AVSpeechSynthesisPersonalVoiceAuthorizationStatus,
        AVSpeechSynthesisVoiceGender,
        AudioComponentValidationResult,
        MusicEventType,
        AVSpeechSynthesizerBufferCallback
    );
    touch_root!(
        AVAudioEnvironmentNode,
        AVAudioPlayerNode,
        AVAudioUnitDelay,
        AVAudioUnitDistortion,
        AVAudioUnitGenerator,
        AVAudioUnitSampler,
        AVAudioUnitTimePitch
    );

    // generated symbols
    touch_generated!(
        CAClockRef,
        AudioCodec,
        AudioCodecPropertyID,
        CAClockTime,
        AUParameterListenerRef,
        AudioUnitEvent,
        AudioSessionPropertyID,
        MusicDeviceComponent
    );
    touch_generated!(
        AudioFile_GetSizeProc,
        AudioFile_ReadProc,
        AudioFile_SetSizeProc,
        AudioFile_WriteProc,
        CAFMarker,
        CAFRegion,
        AUEventListenerRef,
        AudioQueueProcessingTapRef
    );
    touch_generated!(
        CAClockBeats,
        AUNumVersion,
        CAClockTimeFormat,
        MIDIPacketList,
        AudioCodecMagicCookieInfo,
        AudioComponentPlugInInterface,
        AudioQueueParameterEvent,
        AudioUnitOtherPluginDesc
    );
    touch_generated!(
        AudioUnitParameterNameInfo,
        AudioUnitPresetMAS_SettingData,
        AudioUnitRenderContext,
        CAFAudioDescription,
        CAFMarkerChunk,
        CAFOverviewSample,
        CAFPositionPeak,
        CAFRegionChunk
    );
    touch_generated!(
        CAFStringID,
        CAF_SMPTE_Time,
        ScheduledAudioFileRegion,
        ScheduledAudioSlice,
        AudioQueueProcessingTapFlags,
        AudioUnitParameterUnit,
        CAClockPropertyID,
        CAClockSeconds
    );
    touch_generated!(
        CAClockTempo,
        AUChannelInfo,
        AUDependentParameter,
        AUHostIdentifier,
        AUHostVersionIdentifier,
        AUInputSamplesInOutputCallbackStruct,
        AUMIDIOutputCallbackStruct,
        AUParameterMIDIMapping
    );
    touch_generated!(
        AUPreset,
        AUSamplerInstrumentData,
        AUVoiceIOOtherAudioDuckingConfiguration,
        AudioOutputUnitMIDICallbacks,
        AudioOutputUnitStartAtTimeParams,
        AudioUnitCocoaViewInfo,
        AudioUnitConnection,
        AudioUnitExternalBuffer
    );
    touch_generated!(
        AudioUnitFrequencyResponseBin,
        AudioUnitMeterClipping,
        AudioUnitParameterHistoryInfo,
        AudioUnitParameterInfo,
        AudioUnitParameterStringFromValue,
        AudioUnitParameterValueFromString,
        AudioUnitParameterValueTranslation,
        AudioUnitPresetMAS_Settings
    );
    touch_generated!(
        CAFDataChunk,
        CAFInfoStrings,
        CAFInstrumentChunk,
        CAFOverviewChunk,
        CAFPacketTableHeader,
        CAFPeakChunk,
        CAFStrings,
        CAFUMIDChunk
    );
    touch_generated!(
        CAF_UUID_ChunkHeader,
        CAMeterTrackEntry,
        CATempoMapEntry,
        HostCallbackInfo,
        MixerDistanceParams,
        AudioConverterComplexInputDataProc,
        AudioQueuePropertyListenerProc,
        AudioSessionPropertyListener
    );
    touch_generated!(
        CAClockListenerProc,
        CountUserDataFDF,
        GetPropertyFDF,
        GetPropertyInfoFDF,
        GetUserDataFDF,
        GetUserDataSizeFDF,
        ReadBytesFDF,
        ReadPacketsFDF
    );
    touch_generated!(
        SetPropertyFDF,
        SetUserDataFDF,
        WriteBytesFDF,
        WritePacketsFDF
    );

    // protocol markers
    let _: Option<&dyn AVAudioMixing> = None;
    let _: Option<&dyn AUMessageChannel> = None;
    let _: Option<&dyn AVAudio3DMixing> = None;
    let _: Option<&dyn AVAudioPlayerDelegate> = None;
    let _: Option<&dyn AVAudioRecorderDelegate> = None;
    let _: Option<&dyn AVAudioStereoMixing> = None;
    let _: Option<&dyn AVSpeechSynthesizerDelegate> = None;

    assert_eq!(
        get_audio_unit_parameter_display_type(AUDIO_UNIT_PARAMETER_FLAG_DISPLAY_MASK),
        AUDIO_UNIT_PARAMETER_FLAG_DISPLAY_MASK
    );
}
