Skip to content

Commit

Permalink
[macOS] Fix Introspection and API tests (#2891)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Risi authored Oct 23, 2017
1 parent 91ded43 commit 27741b6
Show file tree
Hide file tree
Showing 85 changed files with 328 additions and 298 deletions.
2 changes: 1 addition & 1 deletion src/AVFoundation/AVAssetImageGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class AVAssetImageGenerator {

#if !XAMCORE_2_0
// compatibility method
[Obsolete ("Use the overload that takes NSValue[] instead")]
[Obsolete ("Use the overload that takes 'NSValue[]' instead.")]
public virtual void GenerateCGImagesAsynchronously (NSValue cmTimesRequestedTimes, AVAssetImageGeneratorCompletionHandler handler)
{
NSValue[] values = new NSValue[] { cmTimesRequestedTimes };
Expand Down
2 changes: 1 addition & 1 deletion src/AVFoundation/AVAssetReaderVideoCompositionOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public AVAssetReaderVideoCompositionOutput (AVAssetTrack [] videoTracks, AVVideo
{
}

[Advice ("Use Create method or constructor")]
[Advice ("Use 'Create' method or constructor.")]
public AVAssetReaderVideoCompositionOutput FromTracks (AVAssetTrack [] videoTracks, AVVideoSettings videoSettings)
{
return WeakFromTracks (videoTracks, videoSettings == null ? null : videoSettings.ToDictionary ());
Expand Down
8 changes: 4 additions & 4 deletions src/AVFoundation/AVAudioPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace XamCore.AVFoundation {
#if !XAMCORE_2_0
[Advice ("Use AudioSettings instead")]
[Advice ("Use 'AudioSettings' instead.")]
public class AVAudioPlayerSettings {
NSDictionary dict;

Expand Down Expand Up @@ -139,13 +139,13 @@ public static AVAudioPlayer FromData (NSData data)
}

#if !XAMCORE_2_0
[Obsolete ("This method had an invalid signature in MonoMac 1.0.3, use AVAudioPlayer.FromUrl instead")]
[Obsolete ("This method had an invalid signature in MonoMac 1.0.3, use 'AVAudioPlayer.FromUrl' instead.")]
public AVAudioPlayer (NSUrl url, NSError error) : this (url, IntPtr.Zero)
{

}

[Obsolete ("This method had an invalid signature in MonoMac 1.0.3, use AVAudioPlayer.FromData instead")]
[Obsolete ("This method had an invalid signature in MonoMac 1.0.3, use 'AVAudioPlayer.FromData' instead.")]
public AVAudioPlayer (NSData data, NSError error) : this (data, IntPtr.Zero)
{

Expand All @@ -158,7 +158,7 @@ public AVAudioPlayerSettings Settings {
}
}

[Advice ("This method was incorrectly named, use PlayAtTime instead")]
[Advice ("This method was incorrectly named, use 'PlayAtTime' instead.")]
public bool PlayAtTimetime (double time)
{
return PlayAtTime (time);
Expand Down
6 changes: 3 additions & 3 deletions src/AVFoundation/AVAudioRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace XamCore.AVFoundation {

#if !XAMCORE_2_0
[Advice ("Use AudioSettings instead")]
[Advice ("Use 'AudioSettings' instead.")]
public class AVAudioRecorderSettings {
public AVAudioRecorderSettings ()
{
Expand Down Expand Up @@ -146,7 +146,7 @@ public static AVAudioRecorder Create (NSUrl url, AVAudioFormat format, out NSErr
}

#if !XAMCORE_2_0
[Advice ("Use Create method")]
[Advice ("Use 'Create' method.")]
public static AVAudioRecorder ToUrl (NSUrl url, AVAudioRecorderSettings settings, out NSError error)
{
if (settings == null)
Expand All @@ -159,7 +159,7 @@ public static AVAudioRecorder ToUrl (NSUrl url, AVAudioRecorderSettings settings
#if XAMCORE_2_0
internal
#else
[Advice ("Use Create method")]
[Advice ("Use 'Create' method.")]
public
#endif
static AVAudioRecorder ToUrl (NSUrl url, NSDictionary settings, out NSError error)
Expand Down
8 changes: 4 additions & 4 deletions src/AVFoundation/AVAudioSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public AVAudioSession () : base (NSObjectFlag.Empty)
}
}

[Obsolete ("Use SetActive(bool, out NSError) instead")]
[Obsolete ("Use 'SetActive(bool, out NSError)' instead.")]
public bool SetActive (bool beActive, NSError outError)
{
// Effectively discarded due to original binding error
Expand All @@ -83,7 +83,7 @@ public NSError SetActive (bool active, AVAudioSessionSetActiveOptions options)
#endif

#if !XAMCORE_2_0
[Obsolete ("Use SetCategory(bool, out NSError) instead")]
[Obsolete ("Use 'SetCategory(bool, out NSError)' instead.")]
public bool SetCategory (NSString theCategory, NSError outError)
{
// Effectively discarded due to original binding error
Expand Down Expand Up @@ -137,14 +137,14 @@ public NSError SetCategory (AVAudioSessionCategory category, AVAudioSessionCateg
}

#if !XAMCORE_2_0
[Obsolete ("Use SetPreferredSampleRate(bool, out NSError) on iOS 6.0 instead")]
[Obsolete ("Use 'SetPreferredSampleRate(bool, out NSError)' on iOS 6.0 instead.")]
public bool SetPreferredHardwareSampleRate (double sampleRate, NSError outError)
{
// Effectively discarded due to original binding error
return SetPreferredHardwareSampleRate (sampleRate, out outError);
}

[Obsolete ("Use SetPreferredIOBufferDuration(bool, out NSError) instead")]
[Obsolete ("Use 'SetPreferredIOBufferDuration(bool, out NSError)' instead.")]
public bool SetPreferredIOBufferDuration (double duration, NSError outError)
{
// Effectively discarded due to original binding error
Expand Down
2 changes: 1 addition & 1 deletion src/AVFoundation/AVAudioSessionPortDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace XamCore.AVFoundation {
public partial class AVAudioSessionPortDescription {
#if !XAMCORE_3_0
[Obsolete ("Use DataSourceDescriptions instead")]
[Obsolete ("Use 'DataSourceDescriptions' instead.")]
public virtual AVAudioSessionChannelDescription [] DataSources {
get {
throw new InvalidOperationException ("Call DataSourceDescriptions instead.");
Expand Down
4 changes: 2 additions & 2 deletions src/AVFoundation/AVCaptureDeviceInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
namespace XamCore.AVFoundation {
public partial class AVCaptureDeviceInput {
#if !XAMCORE_2_0
[Obsolete ("Use FromDevice (AVCaptureDevice, out NSError) instead")]
[Obsolete ("Use 'FromDevice (AVCaptureDevice, out NSError)' instead.")]
static public AVCaptureDeviceInput FromDevice (AVCaptureDevice device, IntPtr handle)
{
NSError error;
Expand All @@ -53,7 +53,7 @@ static public AVCaptureDeviceInput FromDevice (AVCaptureDevice device)

#if !XAMCORE_2_0
static NSError globalerr;
[Obsolete ("Use AVCaptureDeviceInput (AVCaptureDevice, out NSError) instead")]
[Obsolete ("Use 'AVCaptureDeviceInput (AVCaptureDevice, out NSError)' instead.")]
public AVCaptureDeviceInput (AVCaptureDevice device, IntPtr handle) : this (device, out globalerr)
{
}
Expand Down
8 changes: 4 additions & 4 deletions src/AVFoundation/AVCaptureVideoDataOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ public AVVideoSettings ()
{
}

[Advice ("Use PixelBufferAttributes")]
[Advice ("Use 'PixelBufferAttributes'.")]
public AVVideoSettings (CVPixelFormatType formatType)
{
PixelFormat = formatType;
}

[Advice ("Use PixelBufferAttributes")]
[Advice ("Use 'PixelBufferAttributes'.")]
public CVPixelFormatType? PixelFormat { get; set; }

[Advice ("Use PixelBufferAttributes")]
[Advice ("Use 'PixelBufferAttributes'.")]
public NSDictionary ToDictionary ()
{
if (!PixelFormat.HasValue)
Expand All @@ -62,7 +62,7 @@ public NSDictionary ToDictionary ()
}

public partial class AVCaptureVideoDataOutput {
[Advice ("Use SetSampleBufferDelegate")]
[Advice ("Use 'SetSampleBufferDelegate'.")]
public void SetSampleBufferDelegateAndQueue (AVCaptureVideoDataOutputSampleBufferDelegate sampleBufferDelegate, DispatchQueue queue)
{
SetSampleBufferDelegate (sampleBufferDelegate, queue);
Expand Down
6 changes: 3 additions & 3 deletions src/AVFoundation/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ public enum AVCaptureFocusMode : nint {

#if !XAMCORE_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Obsolete ("use Locked instead")]
[Obsolete ("Use 'Locked' instead.")]
ModeLocked = Locked,
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Obsolete ("use AutoFocus instead")]
[Obsolete ("Use 'AutoFocus' instead.")]
ModeAutoFocus = AutoFocus,
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Obsolete ("use ContinuousAutoFocus instead")]
[Obsolete ("Use 'ContinuousAutoFocus' instead.")]
ModeContinuousAutoFocus = ContinuousAutoFocus
#endif
}
Expand Down
14 changes: 7 additions & 7 deletions src/AVFoundation/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ InternalAVAudioSessionDelegate EnsureEventDelegate ()
return del;
}

[Obsolete ("Deprecated since iOS 6, Use AVAudioSession.Notification.ObserveInterruptionInstead")]
[Obsolete ("Deprecated since iOS 6, Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
public event EventHandler BeginInterruption {
add {
EnsureEventDelegate ().cbBeginInterruption += value;
Expand All @@ -330,7 +330,7 @@ public event EventHandler BeginInterruption {
}
}

[Obsolete ("Deprecated since iOS 6, Use AVAudioSession.Notification.ObserveInterruptionInstead")]
[Obsolete ("Deprecated since iOS 6, Use 'AVAudioSession.Notification.ObserveInterruption' instead.")]
public event EventHandler EndInterruption {
add {
EnsureEventDelegate ().cbEndInterruption += value;
Expand All @@ -340,7 +340,7 @@ public event EventHandler EndInterruption {
}
}

[Obsolete ("Deprecated since iOS 6, Use AVAudioSession.Notification.ObserveAudioRouteChange")]
[Obsolete ("Deprecated since iOS 6, Use 'AVAudioSession.Notification.ObserveAudioRouteChange'.")]
public event EventHandler<AVCategoryEventArgs> CategoryChanged {
add {
EnsureEventDelegate ().cbCategoryChanged += value;
Expand All @@ -350,7 +350,7 @@ public event EventHandler<AVCategoryEventArgs> CategoryChanged {
}
}

[Obsolete ("Deprecated since iOS 6, Use AVAudioSession.Notification.ObserveAudioRouteChange")]
[Obsolete ("Deprecated since iOS 6, Use 'AVAudioSession.Notification.ObserveAudioRouteChange'.")]
public event EventHandler<AVStatusEventArgs> InputAvailabilityChanged {
add {
EnsureEventDelegate ().cbInputAvailabilityChanged += value;
Expand All @@ -360,7 +360,7 @@ public event EventHandler<AVStatusEventArgs> InputAvailabilityChanged {
}
}

[Obsolete ("Deprecated since iOS 6, Use AVAudioSession.Notification.ObserveAudioRouteChange")]
[Obsolete ("Deprecated since iOS 6, Use 'AVAudioSession.Notification.ObserveAudioRouteChange'.")]
public event EventHandler<AVSampleRateEventArgs> SampleRateChanged {
add {
EnsureEventDelegate ().cbSampleRateChanged += value;
Expand All @@ -371,7 +371,7 @@ public event EventHandler<AVSampleRateEventArgs> SampleRateChanged {
}
}

[Obsolete ("Use AVAudioSession.Notification.ObserveAudioRouteChange, this event does nothing")]
[Obsolete ("Use 'AVAudioSession.Notification.ObserveAudioRouteChange', this event does nothing.")]
public event EventHandler<AVChannelsEventArgs> InputChannelsChanged {
add {
EnsureEventDelegate ().cbInputChanged += value;
Expand All @@ -382,7 +382,7 @@ public event EventHandler<AVChannelsEventArgs> InputChannelsChanged {
}
}

[Obsolete ("Use AVAudioSession.Notification.ObserveAudioRouteChange, this event does nothing")]
[Obsolete ("Use 'AVAudioSession.Notification.ObserveAudioRouteChange', this event does nothing.")]
public event EventHandler<AVChannelsEventArgs> OutputChannelsChanged {
add {
EnsureEventDelegate ().cbOutputChanged += value;
Expand Down
6 changes: 3 additions & 3 deletions src/Accelerate/vImageTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ extern static nint vImageConvolveMultiKernel_ARGB8888 (ref vImageBuffer src,
vImageFlags flags);

#if !XAMCORE_2_0
[Obsolete ("Use the overload with 'short[][] kernels' instead")]
[Obsolete ("Use the overload with 'short[][] kernels' instead.")]
public static vImageError ConvolveMultiKernelARGB8888 (ref vImageBuffer src,
ref vImageBuffer dest,
IntPtr tempBuffer,
Expand Down Expand Up @@ -344,7 +344,7 @@ extern static nint vImageConvolveMultiKernel_ARGBFFFF(ref vImageBuffer src,
vImageFlags flags);

#if !XAMCORE_2_0
[Obsolete ("Use the overload with 'float[][] kernels' instead")]
[Obsolete ("Use the overload with 'float[][] kernels' instead.")]
public static vImageError ConvolveMultiKernelARGBFFFF (ref vImageBuffer src,
ref vImageBuffer dest,
IntPtr tempBuffer,
Expand All @@ -363,7 +363,7 @@ public static vImageError ConvolveMultiKernelARGBFFFF (ref vImageBuffer src,
#endif

#if !XAMCORE_2_0
[Obsolete ("Use the overload with 'float[][] kernels' instead")]
[Obsolete ("Use the overload with 'float[][] kernels' instead.")]
public static vImageError ConvolveMultiKernelARGBFFFF (ref vImageBuffer src,
ref vImageBuffer dest,
IntPtr tempBuffer,
Expand Down
2 changes: 1 addition & 1 deletion src/AppKit/NSApplicationDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace XamCore.AppKit {
public partial class NSApplicationDelegate : NSObject {
#if !XAMCORE_2_0
[Obsolete ("Use DidFinishLaunching (NSNotification) instead")]
[Obsolete ("Use 'DidFinishLaunching (NSNotification)' instead.")]
[Export ("applicationDidFinishLaunching:")]
public virtual void FinishedLaunching (NSObject notification)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AppKit/NSColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public override string ToString ()
}
}

[MountainLion][Obsolete ("Use UnderPageBackgroundColor instead")]
[MountainLion][Obsolete ("Use 'UnderPageBackgroundColor' instead.")]
public static NSColor UnderPageBackground {
get {
return UnderPageBackgroundColor;
Expand Down
4 changes: 2 additions & 2 deletions src/AudioToolbox/AudioBufferList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace XamCore.AudioToolbox
{
#if !XAMCORE_2_0
[Obsolete ("Use AudioBuffers")]
[Obsolete ("Use 'AudioBuffers'.")]
[StructLayout(LayoutKind.Sequential)]
public class AudioBufferList {
// Preserve is support, but Conditional is not, on fields and will mark the type (not optimal)
Expand Down Expand Up @@ -68,7 +68,7 @@ public override string ToString ()
}
}

[Obsolete ("Use AudioBuffers")]
[Obsolete ("Use 'AudioBuffers'.")]
public class MutableAudioBufferList : AudioBufferList, IDisposable {
public MutableAudioBufferList (int nubuffers, int bufferSize)
: base (nubuffers)
Expand Down
4 changes: 2 additions & 2 deletions src/AudioToolbox/AudioFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ extern static AudioFileError AudioFileReadPackets (IntPtr inAudioFile, bool inUs
[MarshalAs (UnmanagedType.LPArray)] AudioStreamPacketDescription[] packetDescriptions, long startingPacket, ref int numPackets, IntPtr buffer);

#if !XAMCORE_2_0
[Obsolete ("Use ReadPacketData instead")]
[Obsolete ("Use 'ReadPacketData' instead.")]
public AudioFileError ReadPackets (bool useCache, out int numBytes,
AudioStreamPacketDescription[] packetDescriptions, long startingPacket, ref int numPackets, IntPtr buffer)
{
Expand Down Expand Up @@ -1208,7 +1208,7 @@ public AudioFileType FileType {
}
}

[Advice ("Use DataFormat instead")]
[Advice ("Use 'DataFormat' instead.")]
public AudioStreamBasicDescription StreamBasicDescription {
get {
return GetProperty<AudioStreamBasicDescription> (AudioFileProperty.DataFormat) ?? default (AudioStreamBasicDescription);
Expand Down
8 changes: 4 additions & 4 deletions src/AudioToolbox/AudioQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ public int DecodeBufferSizeFrames {
}

#if !XAMCORE_3_0
[Obsolete ("Use AudioStreamDescription instead")]
[Obsolete ("Use 'AudioStreamDescription' instead.")]
public AudioStreamBasicDescription AudioStreamPacketDescription {
get {
return AudioStreamDescription;
Expand Down Expand Up @@ -1164,7 +1164,7 @@ extern static AudioQueueStatus AudioQueueProcessingTapNew (IntPtr inAQ, AudioQue
out AudioStreamBasicDescription outProcessingFormat, out IntPtr outAQTap);

#if !XAMCORE_2_0
[Obsolete ("Use CreateProcessingTap (AudioQueueProcessingTapDelegate, AudioQueueProcessingTapFlags, out AudioQueueStatus) instead", true)]
[Obsolete ("Use 'CreateProcessingTap (AudioQueueProcessingTapDelegate, AudioQueueProcessingTapFlags, out AudioQueueStatus)' instead.", true)]
[iOS (6,0)]
public AudioQueueProcessingTap CreateProcessingTap (AudioQueueProcessingTapCallback processingCallback, AudioQueueProcessingTapFlags flags,
out AudioQueueStatus status)
Expand Down Expand Up @@ -1202,7 +1202,7 @@ delegate void AudioQueueProcessingTapCallbackShared (IntPtr clientData, IntPtr t
out uint outNumberFrames, IntPtr data);

#if !XAMCORE_2_0
[Obsolete ("Use AudioQueueProcessingTapDelegate")]
[Obsolete ("Use 'AudioQueueProcessingTapDelegate'.")]
public delegate uint AudioQueueProcessingTapCallback (AudioQueueProcessingTap audioQueueTap, uint numberOfFrames,
ref AudioTimeStamp timeStamp, ref AudioQueueProcessingTapFlags flags,
AudioBufferList data);
Expand Down Expand Up @@ -1269,7 +1269,7 @@ extern static AudioQueueStatus AudioQueueProcessingTapGetSourceAudio (IntPtr inA
out AudioQueueProcessingTapFlags outFlags, out uint outNumberFrames,
AudioBufferList ioData);

[Obsolete ("Use overload with AudioBuffers")]
[Obsolete ("Use overload with 'AudioBuffers'.")]
public AudioQueueStatus GetSourceAudio (uint numberOfFrames, ref AudioTimeStamp timeStamp,
out AudioQueueProcessingTapFlags flags, out uint parentNumberOfFrames, AudioBufferList data)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AudioToolbox/AudioSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public static AudioSessionInterruptionType InterruptionType {
}
}

[Availability (Deprecated = Platform.iOS_5_0, Message = "Use InputRoute or OutputRoute instead")]
[Availability (Deprecated = Platform.iOS_5_0, Message = "Use 'InputRoute' or 'OutputRoute' instead.")]
static public string AudioRoute {
get {
return CFString.FetchString (GetIntPtr (AudioSessionProperty.AudioRoute));
Expand Down
4 changes: 2 additions & 2 deletions src/AudioToolbox/AudioType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ internal unsafe AudioChannelLayout (IntPtr h)
}

#if !WATCH
[Advice ("Use the strongly typed AudioTag instead")]
[Advice ("Use the strongly typed 'AudioTag' instead.")]
public int Tag {
get {
return (int) AudioTag;
Expand All @@ -752,7 +752,7 @@ public int Tag {
}
}

[Advice ("Use ChannelUsage instead")]
[Advice ("Use 'ChannelUsage' instead.")]
public int Bitmap {
get {
return (int) ChannelUsage;
Expand Down
Loading

0 comments on commit 27741b6

Please sign in to comment.