Skip to content

Commit 4cf4515

Browse files
authored
Merge pull request #32515 from lorentey/UIKit-NSValueBridging-tests
[test] Reinstate CoreGraphics↔︎NSValue bridging tests on iOS/watchOS/tvOS
2 parents ad69927 + b3fb762 commit 4cf4515

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/stdlib/NSValueBridging.swift.gyb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@
1818
//
1919
// REQUIRES: objc_interop
2020

21+
// The UIKit overlay isn't present on iOS 10.3.
22+
// UNSUPPORTED: CPU=i386
23+
2124
import StdlibUnittest
2225
import StdlibUnittestFoundationExtras
2326
import Foundation
2427
import CoreGraphics
2528

29+
#if os(iOS) || os(tvOS) || os(watchOS)
30+
import UIKit
31+
#endif
32+
2633
var nsValueBridging = TestSuite("NSValueBridging")
2734

2835
func rangesEqual(_ x: NSRange, _ y: NSRange) -> Bool {
@@ -66,6 +73,16 @@ ${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", N
6673

6774
#endif
6875

76+
#if os(iOS) || os(tvOS) || os(watchOS)
77+
78+
${ testCase("CGRect", "CGRect(x: 17, y: 38, width: 6, height: 79)", "cgRect", "(==)") }
79+
${ testCase("CGPoint", "CGPoint(x: 17, y: 38)", "cgPoint", "(==)") }
80+
${ testCase("CGSize", "CGSize(width: 6, height: 79)", "cgSize", "(==)") }
81+
${ testCase("CGVector", "CGVector(dx: 6, dy: 79)", "cgVector", "(==)") }
82+
${ testCase("CGAffineTransform", "CGAffineTransform(rotationAngle: .pi)", "cgAffineTransform", "(==)") }
83+
84+
#endif
85+
6986
nsValueBridging.test("NSValue can only be cast back to its original type") {
7087
let range = NSRange(location: 17, length: 38)
7188
let rangeObject: Any = NSValue(range: range)

0 commit comments

Comments
 (0)