Skip to content

Commit

Permalink
[tests][xtro] Some fixes, mostly data, so [ios|tvos|watchos].unclassi…
Browse files Browse the repository at this point in the history
…fied are empty (dotnet#1766)

Also reduce a bit the size of common.unclassified
  • Loading branch information
spouliot committed Mar 28, 2017
1 parent 566a7a4 commit 9686e64
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ public enum NSUrlCredentialPersistence : nuint_compat_int {
}

#if MONOMAC || !XAMCORE_3_0

#if !XAMCORE_4_0
[Native]
public enum NSBundleExecutableArchitecture : nint {
#else
public enum NSBundleExecutableArchitecture {
#endif
I386 = 0x00000007,
PPC = 0x00000012,
X86_64 = 0x01000007,
Expand Down Expand Up @@ -851,6 +856,7 @@ public enum NSLigatureType : nint {
None, Default, All
}

#if !XAMCORE_4_0
[Flags]
[Native]
public enum NSDateComponentsWrappingBehavior : nuint_compat_int {
Expand All @@ -859,6 +865,7 @@ public enum NSDateComponentsWrappingBehavior : nuint_compat_int {

// Did not add the new enums here, we moved them elsewhere, and provided overloads.
}
#endif

[Flags]
[Native]
Expand Down
6 changes: 6 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,20 @@ interface NSCalendar : NSSecureCoding, NSCopying {
[Export ("components:fromDate:toDate:options:")]
NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSCalendarOptions opts);

#if !XAMCORE_4_0
[Obsolete ("Use the overload with a NSCalendarOptions parameter")]
[Wrap ("Components (unitFlags, fromDate, toDate, (NSCalendarOptions) opts)")]
NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSDateComponentsWrappingBehavior opts);
#endif

[Export ("dateByAddingComponents:toDate:options:")]
NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSCalendarOptions opts);

#if !XAMCORE_4_0
[Obsolete ("Use the overload with a NSCalendarOptions parameter")]
[Wrap ("DateByAddingComponents (comps, date, (NSCalendarOptions) opts)")]
NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSDateComponentsWrappingBehavior opts);
#endif

[Export ("dateFromComponents:")]
NSDate DateFromComponents (NSDateComponents comps);
Expand Down
3 changes: 3 additions & 0 deletions tests/xtro-sharpie/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public static class Helpers {
{ "NEVPNStatus", "NEVpnStatus" },
{ "NSAttributedStringEnumerationOptions", "NSAttributedStringEnumeration" },
{ "NSHTTPCookieAcceptPolicy", "NSHttpCookieAcceptPolicy" },
{ "NSISO8601DateFormatOptions", "NSIso8601DateFormatOptions" },
{ "NSJSONReadingOptions", "NSJsonReadingOptions" },
{ "NSJSONWritingOptions", "NSJsonWritingOptions" },
{ "NSUbiquitousKeyValueStoreChangeReason", "NSUbiquitousKeyValueStore" },
{ "NSURLBookmarkCreationOptions", "NSUrlBookmarkCreationOptions" },
{ "NSURLBookmarkResolutionOptions", "NSUrlBookmarkResolutionOptions" },
{ "NSURLCacheStoragePolicy", "NSUrlCacheStoragePolicy" },
Expand All @@ -51,6 +53,7 @@ public static class Helpers {
{ "NSURLRequestNetworkServiceType", "NSUrlRequestNetworkServiceType" },
{ "NSURLSessionAuthChallengeDisposition", "NSUrlSessionAuthChallengeDisposition" },
{ "NSURLSessionResponseDisposition", "NSUrlSessionResponseDisposition" },
{ "NSURLSessionTaskMetricsResourceFetchType", "NSUrlSessionTaskMetricsResourceFetchType" },
{ "NSURLSessionTaskState", "NSUrlSessionTaskState" },
{ "NWTCPConnectionState", "NWTcpConnectionState" },
{ "NWUDPSessionState", "NWUdpSessionState" },
Expand Down
12 changes: 12 additions & 0 deletions tests/xtro-sharpie/common.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
## deprecated in iOS8
!missing-protocol-member! AVAudioRecorderDelegate::audioRecorderEndInterruption:withOptions: not found

## Used only once in a deprecated API, native use `NSInteger` not a real enum - that's why there's a `[Native]`
!unknown-native-enum! AVAudioSessionFlags bound

## native use `NSUInteger` not a real enum - that's why there's a `[Native]`
!unknown-native-enum! AVAudioSessionInterruptionFlags bound


# CoreGraphics

Expand All @@ -43,6 +49,12 @@
!missing-selector! NSNumber::initWithLong: not bound
!missing-selector! NSNumber::initWithUnsignedLong: not bound

## should not have been [Native] it's 32bits only values -> XAMCORE_4_0
!unknown-native-enum! NSBundleExecutableArchitecture bound

## enum was [re]named to NSCalendarOptions - excluding from XAMCORE_4_0
!unknown-native-enum! NSDateComponentsWrappingBehavior bound


# GameKit

Expand Down
129 changes: 129 additions & 0 deletions tests/xtro-sharpie/common.pending
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# AVFoundation

## to be re-enabled when merging to master - https://bugzilla.xamarin.com/show_bug.cgi?id=52730
!missing-field! AVAudioSessionInterruptionWasSuspendedKey not bound


# CoreData

## https://bugzilla.xamarin.com/show_bug.cgi?id=34968
Expand Down Expand Up @@ -94,20 +100,95 @@

# missing - pending decision for implementation
!missing-type! NSAssertionHandler not bound
!missing-field! NSAssertionHandlerKey not bound
!missing-selector! +NSAssertionHandler::currentHandler not bound
!missing-selector! NSAssertionHandler::handleFailureInFunction:file:lineNumber:description: not bound
!missing-selector! NSAssertionHandler::handleFailureInMethod:object:file:lineNumber:description: not bound

## collections - many are special
!missing-type! NSCountedSet not bound
!missing-selector! NSCountedSet::addObject: not bound
!missing-selector! NSCountedSet::countForObject: not bound
!missing-selector! NSCountedSet::initWithArray: not bound
!missing-selector! NSCountedSet::initWithCapacity: not bound
!missing-selector! NSCountedSet::initWithSet: not bound
!missing-selector! NSCountedSet::removeObject: not bound

!missing-type! NSHashTable not bound
!missing-selector! +NSHashTable::hashTableWithOptions: not bound
!missing-selector! NSHashTable::addObject: not bound
!missing-selector! NSHashTable::allObjects not bound
!missing-selector! NSHashTable::anyObject not bound
!missing-selector! NSHashTable::containsObject: not bound
!missing-selector! NSHashTable::count not bound
!missing-selector! NSHashTable::initWithOptions:capacity: not bound
!missing-selector! NSHashTable::initWithPointerFunctions:capacity: not bound
!missing-selector! NSHashTable::intersectHashTable: not bound
!missing-selector! NSHashTable::intersectsHashTable: not bound
!missing-selector! NSHashTable::isEqualToHashTable: not bound
!missing-selector! NSHashTable::isSubsetOfHashTable: not bound
!missing-selector! NSHashTable::member: not bound
!missing-selector! NSHashTable::minusHashTable: not bound
!missing-selector! NSHashTable::pointerFunctions not bound
!missing-selector! NSHashTable::removeObject: not bound
!missing-selector! NSHashTable::setRepresentation not bound
!missing-selector! NSHashTable::unionHashTable: not bound

!missing-type! NSMapTable not bound
!missing-selector! +NSMapTable::mapTableWithKeyOptions:valueOptions: not bound
!missing-selector! NSMapTable::count not bound
!missing-selector! NSMapTable::initWithKeyOptions:valueOptions:capacity: not bound
!missing-selector! NSMapTable::initWithKeyPointerFunctions:valuePointerFunctions:capacity: not bound
!missing-selector! NSMapTable::keyPointerFunctions not bound
!missing-selector! NSMapTable::objectForKey: not bound
!missing-selector! NSMapTable::removeObjectForKey: not bound
!missing-selector! NSMapTable::setObject:forKey: not bound
!missing-selector! NSMapTable::valuePointerFunctions not bound

!missing-type! NSPointerArray not bound
!missing-selector! NSPointerArray::addPointer: not bound
!missing-selector! NSPointerArray::allObjects not bound
!missing-selector! NSPointerArray::count not bound
!missing-selector! NSPointerArray::initWithOptions: not bound
!missing-selector! NSPointerArray::initWithPointerFunctions: not bound
!missing-selector! NSPointerArray::insertPointer:atIndex: not bound
!missing-selector! NSPointerArray::pointerAtIndex: not bound
!missing-selector! NSPointerArray::pointerFunctions not bound
!missing-selector! NSPointerArray::removePointerAtIndex: not bound
!missing-selector! NSPointerArray::replacePointerAtIndex:withPointer: not bound
!missing-selector! NSPointerArray::setCount: not bound

!missing-type! NSPointerFunctions not bound
!missing-selector! NSPointerFunctions::acquireFunction not bound
!missing-selector! NSPointerFunctions::descriptionFunction not bound
!missing-selector! NSPointerFunctions::hashFunction not bound
!missing-selector! NSPointerFunctions::initWithOptions: not bound
!missing-selector! NSPointerFunctions::isEqualFunction not bound
!missing-selector! NSPointerFunctions::relinquishFunction not bound
!missing-selector! NSPointerFunctions::setAcquireFunction: not bound
!missing-selector! NSPointerFunctions::setDescriptionFunction: not bound
!missing-selector! NSPointerFunctions::setHashFunction: not bound
!missing-selector! NSPointerFunctions::setIsEqualFunction: not bound
!missing-selector! NSPointerFunctions::setRelinquishFunction: not bound
!missing-selector! NSPointerFunctions::setSizeFunction: not bound
!missing-selector! NSPointerFunctions::setUsesStrongWriteBarrier: not bound
!missing-selector! NSPointerFunctions::setUsesWeakReadAndWriteBarriers: not bound
!missing-selector! NSPointerFunctions::sizeFunction not bound
!missing-selector! NSPointerFunctions::usesStrongWriteBarrier not bound
!missing-selector! NSPointerFunctions::usesWeakReadAndWriteBarriers not bound


# regex
!missing-type! NSDataDetector not bound
!missing-selector! NSDataDetector::initWithTypes:error: not bound

!missing-type! NSRegularExpression not bound
!missing-selector! +NSRegularExpression::regularExpressionWithPattern:options:error: not bound
!missing-enum! NSRegularExpressionOptions not bound

!missing-type! NSDecimalNumberHandler not bound
!missing-selector! +NSDecimalNumberHandler::decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero: not bound
!missing-selector! NSDecimalNumberHandler::initWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero: not bound
!missing-protocol! NSDecimalNumberBehaviors not bound

## coredata
Expand All @@ -125,6 +206,34 @@

## string scanning, looks helpful (porting code)
!missing-type! NSScanner not bound
!missing-selector! +NSScanner::localizedScannerWithString: not bound
!missing-selector! +NSScanner::scannerWithString: not bound
!missing-selector! NSScanner::caseSensitive not bound
!missing-selector! NSScanner::charactersToBeSkipped not bound
!missing-selector! NSScanner::initWithString: not bound
!missing-selector! NSScanner::isAtEnd not bound
!missing-selector! NSScanner::locale not bound
!missing-selector! NSScanner::scanCharactersFromSet:intoString: not bound
!missing-selector! NSScanner::scanDecimal: not bound
!missing-selector! NSScanner::scanDouble: not bound
!missing-selector! NSScanner::scanFloat: not bound
!missing-selector! NSScanner::scanHexDouble: not bound
!missing-selector! NSScanner::scanHexFloat: not bound
!missing-selector! NSScanner::scanHexInt: not bound
!missing-selector! NSScanner::scanHexLongLong: not bound
!missing-selector! NSScanner::scanInt: not bound
!missing-selector! NSScanner::scanInteger: not bound
!missing-selector! NSScanner::scanLocation not bound
!missing-selector! NSScanner::scanLongLong: not bound
!missing-selector! NSScanner::scanString:intoString: not bound
!missing-selector! NSScanner::scanUnsignedLongLong: not bound
!missing-selector! NSScanner::scanUpToCharactersFromSet:intoString: not bound
!missing-selector! NSScanner::scanUpToString:intoString: not bound
!missing-selector! NSScanner::setCaseSensitive: not bound
!missing-selector! NSScanner::setCharactersToBeSkipped: not bound
!missing-selector! NSScanner::setLocale: not bound
!missing-selector! NSScanner::setScanLocation: not bound
!missing-selector! NSScanner::string not bound

## abstract
!missing-type! NSValueTransformer not bound
Expand Down Expand Up @@ -220,6 +329,26 @@
!missing-selector! NSXMLParser::shouldProcessNamespaces is not bound
!missing-selector! NSXMLParser::shouldReportNamespacePrefixes is not bound
!missing-selector! NSXMLParser::shouldResolveExternalEntities is not bound
!missing-selector! NSXMLParser::allowedExternalEntityURLs not bound
!missing-selector! NSXMLParser::columnNumber not bound
!missing-selector! NSXMLParser::delegate not bound
!missing-selector! NSXMLParser::externalEntityResolvingPolicy not bound
!missing-selector! NSXMLParser::initWithContentsOfURL: not bound
!missing-selector! NSXMLParser::initWithData: not bound
!missing-selector! NSXMLParser::initWithStream: not bound
!missing-selector! NSXMLParser::lineNumber not bound
!missing-selector! NSXMLParser::parserError not bound
!missing-selector! NSXMLParser::publicID not bound
!missing-selector! NSXMLParser::setAllowedExternalEntityURLs: not bound
!missing-selector! NSXMLParser::setDelegate: not bound
!missing-selector! NSXMLParser::setExternalEntityResolvingPolicy: not bound
!missing-selector! NSXMLParser::setShouldProcessNamespaces: not bound
!missing-selector! NSXMLParser::setShouldReportNamespacePrefixes: not bound
!missing-selector! NSXMLParser::setShouldResolveExternalEntities: not bound
!missing-selector! NSXMLParser::shouldProcessNamespaces not bound
!missing-selector! NSXMLParser::shouldReportNamespacePrefixes not bound
!missing-selector! NSXMLParser::shouldResolveExternalEntities not bound
!missing-selector! NSXMLParser::systemID not bound
!missing-protocol! NSXMLParserDelegate not bound
!missing-selector! NSXMLParserDelegate::parser:didEndElement:namespaceURI:qualifiedName: is not bound
!missing-selector! NSXMLParserDelegate::parser:didEndMappingPrefix: is not bound
Expand Down
9 changes: 4 additions & 5 deletions tests/xtro-sharpie/ios.pending
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,8 @@
!missing-selector! INRequestRideIntent::initWithPickupLocation:dropOffLocation:rideOptionName:partySize:paymentMethod:pickupTime: not bound
!missing-selector! INRequestRideIntent::pickupTime not bound

# UIKit

# TODO: MUST BE FIXED by SR0 or SR1 of iOS 10 related bug https://bugzilla.xamarin.com/show_bug.cgi?id=43579
!missing-protocol-member! UITextFieldDelegate::textFieldDidEndEditing:reason: not found
!missing-protocol-member! UITextViewDelegate::textView:shouldInteractWithTextAttachment:inRange:interaction: not found
!missing-protocol-member! UITextViewDelegate::textView:shouldInteractWithURL:inRange:interaction: not found
# UIKit

## HACK: those members are not *required* in ObjC but we made them
## abstract to have them inlined in UITextField and UITextView
Expand Down Expand Up @@ -323,6 +319,9 @@
## It seems that Apple added a setter but it seems it is a mistake on the newly added property radar:27929872
!missing-selector! UIViewController::setDisablesAutomaticKeyboardDismissal: not bound

## exception name, not clear if useful
!missing-field! UIApplicationInvalidInterfaceOrientationException not bound


# WatchKit

Expand Down

0 comments on commit 9686e64

Please sign in to comment.