Commit Graph

20 Commits

Author SHA1 Message Date
Erik Eckstein
75d71e3ed2 tests: disable stdlib/NSValueBridging.swift.gyb for watchos 2024-07-31 10:24:47 +02:00
Karoy Lorentey
5f489fc719 [test] Fix architecture conditional
rdar://64995079
2020-07-14 18:55:41 -07:00
Nate Chandler
c5270a5968 [Test] Xfail stdlib/NSValueBridging.swift
rdar://problem/64995079
2020-07-10 06:29:52 -07:00
Karoy Lorentey
b42910a430 [test] Reenable NSValueBridging tests on i386
Instead, disable tests we cannot run with a targeted platform conditional.
2020-07-08 22:33:17 -07:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Károly Lőrentey
b3fb7626c1 [test] Don’t import UIKit on iOS 10.3 2020-06-29 18:44:22 -07:00
Karoy Lorentey
73c99acf29 [test] Reinstate CoreGraphics↔︎NSValue bridging tests on iOS/watchOS/tvOS 2020-06-29 16:46:50 -07:00
Mishal Shah
272c466e47 Update master to build with Xcode 12 beta 2020-06-22 15:43:20 -07:00
Karoy Lorentey
8ae76342f8 [Foundation] Set correct availability on NSValue.value(of:)
(cherry picked from commit 35a47b3a55e113fd1212485b85d808427ccf5dea)
2019-06-13 20:10:06 -07:00
Karoy Lorentey
fb55fc3be8 [redux][Foundation] Fix availability of NSValue.value(of:) (#25179)
* [Foundation] Fix availability of NSValue.value(of:)

(cherry picked from commit fbe5563d60)

* [Foundation] NSValue.value(of:): Reinstate runtime OS version check
2019-05-31 17:36:24 -07:00
Brent Royal-Gordon
dce879f508 Revert "[Foundation] Fix availability of NSValue.value(of:)" 2019-05-15 05:17:42 -07:00
Karoy Lorentey
fbe5563d60 [Foundation] Fix availability of NSValue.value(of:) 2019-05-03 19:55:03 -07:00
Philippe Hausler
1fe1b86556 Add a safe API for NSValue and migrate NSValue value fetching to the size variants for validation (#22265) 2019-02-13 14:14:41 -08:00
Arnold Schwaighofer
2d8a1dbbfe Codesign test/stdlib 2018-08-10 06:58:40 -07:00
Sho Ikeda
b68be20e9d [test][gardening] Prefer os(macOS) over os(OSX) 2018-03-11 10:58:58 +09:00
Saleem Abdulrasool
b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
6ed605b018 [gardening] Fix incorrect header. 2016-09-25 20:41:43 +02:00
Joe Groff
86fbeee285 SE-0139: Bridge Cocoa framework structs to NSValue.
For every struct type for which the frameworks provides an NSValue category for boxing and unboxing values of that type, provide an _ObjectiveCBridgeable conformance in the Swift overlay that bridges that struct to NSValue, allowing the structs to be used naturally with id-as-Any APIs and Cocoa container classes. This is mostly a matter of gyb-ing out boilerplate using `NSValue.init(bytes:objCType:)` to construct the instance, `NSValue.objCType` to check its type when casting, and `NSValue.getValue(_:)` to extract the unboxed value, though there are a number of special snowflake cases that need special accommodation:

- To maintain proper layering, CoreGraphics structs need to be bridged in the Foundation overlay.
- AVFoundation provides the NSValue boxing categories for structs owned by CoreMedia, but it does so using its own internal subclasses of NSValue, and these subclasses do not interop properly with the standard `NSValue` subclasses instantiated by Foundation. To do the right thing, we therefore have to let AVFoundation provide the bridging implementation for the CoreMedia types, and we have to use its category methods to do so.
- SceneKit provides NSValue categories to box and unbox SCNVector3, SCNVector4, and SCNMatrix4; however, the methods it provides do so in an unusual way. SCNVector3 and SCNVector4 are packaged into `CGRect`s and then the CGRect is boxed using `valueWithCGRect:`. SCNMatrix4 is copied into a CATransform3D, which is then boxed using `valueWithCATransform3D:` from CoreAnimation. To be consistent with what SceneKit does, use its category methods for these types as well, and when casting, check the type against the type encoding SceneKit uses rather than the type encoding of the expected type.
2016-09-21 19:26:10 -07:00