xamarin-macios/tests/monotouch-test/CoreFoundation
Sebastien Pouliot 0d95c4a5b9
[net][objcruntime] Add `GetHashCode` and `Equals` to `DisposableObject` (#13746)
* Ensure all `DisposableObject` subclasses have an implementation based
  on their `Handle` property and not relying on `System.Object` default.
  E.g. `CFArray`, `CFString`...

* Reduce code duplication for the few subclasses that have overrides
  doing just the same, e.g. `Class`, `Selector`

Types subclassing `NativeObject` that had `Equals` and `GetHashCode` overridden

* CoreFoundation.CFRunLoop
* CoreFoundation.DispatchObject (and DispatchQueue subclass)
* CoreGraphics.CGColor -> special case with it's own [native equality function](https://developer.apple.com/documentation/coregraphics/1455217-cgcolorequaltocolor) [1]
* CoreGraphics.CGPath -> special case with it's own [native equality function](https://developer.apple.com/documentation/coregraphics/1411167-cgpathequaltopath) [1]
* Security.SecPolicy

[1] this is a **BUG** since `Equals` can return `true` while `GetHashCode` returns different values !?!?!

> Two objects that are equal return hash codes that are equal.
https://docs.microsoft.com/en-us/dotnet/api/system.object.gethashcode?view=net-6.0

I'm not sure how to get a good _fast_ hash code...

> However, the reverse is not true: equal hash codes do not imply object equality, because different (unequal) objects can have identical hash codes.

but returning a constant if fast and valid - even if it looks funky.

Subclasses that did not have `Equals` and `GetHashCode` implemented

* VideoToolbox.VTFrameSilo
* VideoToolbox.VTMultiPassStorage
* VideoToolbox.VTSession
* SystemConfiguration.NetworkReachability
* Security.SecCertificate
* Security.SecIdentity
* Security.SecKey
* Security.SecAccessControl
* Security.SecCertificate2
* Security.SecIdentity2
* Security.SecProtocolMetadata
* Security.SecProtocolOptions
* Security.SecTrust
* Security.SecTrust2
* Security.SslContext
* Network.NWAdvertiseDescriptor
* Network.NWBrowseResult
* Network.NWBrowser
* Network.NWBrowserDescriptor
* Network.NWConnection
* Network.NWConnectionGroup
* Network.NWContentContext
* Network.NWDataTransferReport
* Network.NWEndpoint
* Network.NWError
* Network.NWEstablishmentReport
* Network.NWFramer
* Network.NWInterface
* Network.NWListener
* Network.NWMulticastGroup
* Network.NWParameters
* Network.NWPath
* Network.NWPathMonitor
* Network.NWPrivacyContext
* Network.NWProtocolDefinition
* Network.NWProtocolMetadata
* Network.NWProtocolOptions
* Network.NWProtocolStack
* Network.NWResolutionReport
* Network.NWResolverConfig
* Network.NWTxtRecord
* Network.NWWebSocketRequest
* Network.NWWebSocketResponse
* MediaToolbox.MTAudioProcessingTap
* ImageIO.CGImageDestination
* ImageIO.CGImageMetadata
* ImageIO.CGImageMetadataTag
* ImageIO.CGImageSource
* CoreVideo.CVBuffer
* CoreVideo.CVMetalTexture
* CoreVideo.CVMetalTextureCache
* CoreVideo.CVPixelBufferPool
* CoreText.CTFont
* CoreText.CTFontCollection
* CoreText.CTFontDescriptor
* CoreText.CTFrame
* CoreText.CTFramesetter
* CoreText.CTGlyphInfo
* CoreText.CTLine
* CoreText.CTParagraphStyle
* CoreText.CTRun
* CoreText.CTRunDelegate
* CoreText.CTTextTab
* CoreText.CTTypesetter
* CoreMedia.CMBlockBuffer
* CoreMedia.CMBufferQueue
* CoreMedia.CMFormatDescription
* CoreMedia.CMMemoryPool
* CoreMedia.CMSampleBuffer
* CoreMedia.CMClockOrTimebase
* CoreGraphics.CGColorConversionInfo
* CoreGraphics.CGColorConverter
* CoreGraphics.CGColorSpace
* CoreGraphics.CGContext
* CoreGraphics.CGDataConsumer
* CoreGraphics.CGDataProvider
* CoreGraphics.CGFont
* CoreGraphics.CGFunction
* CoreGraphics.CGGradient
* CoreGraphics.CGImage
* CoreGraphics.CGLayer
* CoreGraphics.CGPDFContentStream
* CoreGraphics.CGPDFDocument
* CoreGraphics.CGPDFOperatorTable
* CoreGraphics.CGPDFPage
* CoreGraphics.CGPDFScanner
* CoreGraphics.CGPattern
* CoreGraphics.CGShading
* CoreFoundation.CFBundle
* CoreFoundation.CFAllocator
* CoreFoundation.CFArray
* CoreFoundation.CFBoolean
* CoreFoundation.CFData
* CoreFoundation.CFDictionary
* CoreFoundation.CFMachPort
* CoreFoundation.CFMessagePort
* CoreFoundation.CFNotificationCenter
* CoreFoundation.CFPropertyList
* CoreFoundation.CFRunLoopSource
* CoreFoundation.CFString
* CoreFoundation.CFType
* CoreFoundation.CFUrl
* CoreFoundation.DispatchBlock
* CoreFoundation.OSLog
* CoreServices.CFHost
* AddressBook.ABAddressBook
* AddressBook.ABMultiValue<T>
* AddressBook.ABRecord
* ObjCRuntime.BaseWrapper
2022-01-19 08:22:24 +01:00
..
ArrayTest.cs [Tests] Remove not needed usings in the CoreData and CoreFoundation tests. (#13254) 2021-11-03 16:48:48 -04:00
BundleTest.cs [tests] Remove assert that fails on M1 on Rosetta. (#12641) 2021-09-07 18:52:53 +02:00
DispatchBlockTests.cs [tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350) 2021-11-15 08:06:36 +01:00
DispatchDataTest.cs [Tests] Remove not needed usings in the CoreData and CoreFoundation tests. (#13254) 2021-11-03 16:48:48 -04:00
DispatchGroupTest.cs [tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350) 2021-11-15 08:06:36 +01:00
DispatchQueueTest.cs [tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350) 2021-11-15 08:06:36 +01:00
DispatchTests.cs [tests] Remove a few Assert.Inconclusive calls that won't be executed anymore. (#13557) 2021-12-14 17:06:09 +01:00
MutableString.cs [corefoundation] Add missing CFStringTransform API. Fixes #5705 (#5712) 2019-03-06 08:04:17 -05:00
NativeObjectTest.cs [net][objcruntime] Add `GetHashCode` and `Equals` to `DisposableObject` (#13746) 2022-01-19 08:22:24 +01:00
NetworkTest.cs [tests] The HttpWebRequest constructors are not publicly available in .NET 5, so use WebRequest.CreateHttp instead. (#9157) 2020-07-23 08:37:45 +02:00
NotificationCenterTest.cs [Tests] Remove not needed usings in the CoreData and CoreFoundation tests. (#13254) 2021-11-03 16:48:48 -04:00
OSLogTest.cs [Tests] Remove not needed usings in the CoreData and CoreFoundation tests. (#13254) 2021-11-03 16:48:48 -04:00
PropertyListTests.cs [src] Adjust visibility of numerous (IntPtr) and (IntPtr, bool) constructors (#13444) 2021-11-26 14:24:05 +01:00
ProxyTest.cs [CFNetwork] Move the CFHost and CFHTTP* types to the CFNetwork namespace in .NET. (#13761) 2022-01-19 08:07:06 +01:00
StringTest.cs [Tests] Fix cecil tests. (#12853) 2021-09-28 08:09:23 -04:00
UrlTest.cs [tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350) 2021-11-15 08:06:36 +01:00