Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CoreImage/CIFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ internal CIFilter (string name)
/// <summary>Returns an array of strings that specifies the filters taht the system provides for the specified <paramref name="categories" />.</summary>
/// <returns>To be added.</returns>
/// <remarks>To be added.</remarks>
public static string [] FilterNamesInCategories (params string [] categories)
public static string [] FilterNamesInCategories (params string []? categories)
{
return _FilterNamesInCategories (categories);
}
Expand Down
10 changes: 4 additions & 6 deletions src/Security/Policy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ internal SecPolicy (NativeHandle handle, bool owns)
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* SecPolicyRef */ SecPolicyCreateSSL (byte server, IntPtr /* CFStringRef */ hostname);

/// <summary>Create a policy instance that represents the SSL/TLS profile.</summary>
/// <param name="server">Indicate if the policy is for a server (true) or client (false) certificate.</param>
/// <param name="hostName">The server host name on which the policy will be applied.</param>
/// <summary>Create a policy instance that represent the SSL/TLS profile.</summary>
/// <returns>A SecPolicy instance that can be used to validate a SecCertificate using SecTrust.</returns>
/// <remarks>
/// </remarks>
static public SecPolicy CreateSslPolicy (bool server, string hostName)
/// <param name="hostName">The server host name on which the policy will be applied, or <see langword="null" /> to create a policy without a specific host name (disables host name validation).</param>
/// <returns>A SecPolicy instance that can be used to validate a SecCertificate using SecTrust.</returns>
static public SecPolicy CreateSslPolicy (bool server, string? hostName)
{
var handle = CFString.CreateNative (hostName);
try {
Expand Down
6 changes: 4 additions & 2 deletions src/SystemConfiguration/NetworkReachability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,15 @@ public NetworkReachability (string address)
[ObsoletedOSPlatform ("maccatalyst17.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
[ObsoletedOSPlatform ("tvos17.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
[ObsoletedOSPlatform ("macos14.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
static IntPtr Create (IPAddress localAddress, IPAddress remoteAddress)
static IntPtr Create (IPAddress? localAddress, IPAddress? remoteAddress)
{
if (localAddress is null && remoteAddress is null)
throw new ArgumentException ("At least one address is required");

IntPtr handle;
if (localAddress is null) {
if (remoteAddress is null)
throw new ArgumentException ("At least one address is required");
var remote = new sockaddr_in (remoteAddress);

unsafe {
Expand Down Expand Up @@ -411,7 +413,7 @@ static IntPtr Create (IPAddress localAddress, IPAddress remoteAddress)
[ObsoletedOSPlatform ("maccatalyst17.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
[ObsoletedOSPlatform ("tvos17.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
[ObsoletedOSPlatform ("macos14.4", "Use 'NSUrlSession' or 'NWConnection' instead.")]
public NetworkReachability (IPAddress localAddress, IPAddress remoteAddress)
public NetworkReachability (IPAddress? localAddress, IPAddress? remoteAddress)
: base (Create (localAddress, remoteAddress), true)
{
}
Expand Down
4 changes: 2 additions & 2 deletions tests/introspection/ApiCoreImageFiltersTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void CheckNativeFilters ()
int n = 0;
string qname = CIFilterType.AssemblyQualifiedName;
// that will give us only the list of filters supported by the executing version of iOS
foreach (var filter_name in CIFilter.FilterNamesInCategories (null)) {
foreach (var filter_name in CIFilter.FilterNamesInCategories ()) {
if (Skip (filter_name))
continue;
string type_name = qname.Replace ("CIFilter", filter_name);
Expand All @@ -108,7 +108,7 @@ public void CheckManagedFilters ()
{
Errors = 0;
ContinueOnFailure = true;
List<string> filters = new List<string> (CIFilter.FilterNamesInCategories (null));
var filters = new List<string> (CIFilter.FilterNamesInCategories ());
var superFilters = new List<string> ();
var nspace = CIFilterType.Namespace;
var types = CIFilterType.Assembly.GetTypes ();
Expand Down
11 changes: 11 additions & 0 deletions tests/monotouch-test/CoreImage/FilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,16 @@ public void CIVectorArray ()
Assert.Null (f.Mesh, "Mesh/Null/again");
}
}

[Test]
public void FilterNamesInCategories ()
{
var a = CIFilter.FilterNamesInCategories ();
var b = CIFilter.FilterNamesInCategories (null);

Assert.That (a, Is.EquivalentTo (b), "Filtering");
Assert.That (a.Length, Is.GreaterThan (0), "Filtered A");
Assert.That (b.Length, Is.GreaterThan (0), "Filtered B");
}
}
}
Loading