Skip to content

Commit 466a579

Browse files
committed
Remove platform check in tests
1 parent 4e29c0f commit 466a579

File tree

8 files changed

+0
-118
lines changed

8 files changed

+0
-118
lines changed

Tests/PackageCollectionsSigningTests/CertificatePolicyTests.swift

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import TSCBasic
1818

1919
class CertificatePolicyTests: XCTestCase {
2020
func test_RSA_validate_happyCase() throws {
21-
if !isSupportedPlatform {
22-
try XCTSkipIf(true)
23-
}
24-
2521
fixture(name: "Collections") { directoryPath in
2622
let certPath = directoryPath.appending(components: "Signing", "Test_rsa.cer")
2723
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -40,10 +36,6 @@ class CertificatePolicyTests: XCTestCase {
4036
}
4137

4238
func test_EC_validate_happyCase() throws {
43-
if !isSupportedPlatform {
44-
try XCTSkipIf(true)
45-
}
46-
4739
fixture(name: "Collections") { directoryPath in
4840
let certPath = directoryPath.appending(components: "Signing", "Test_ec.cer")
4941
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -62,10 +54,6 @@ class CertificatePolicyTests: XCTestCase {
6254
}
6355

6456
func test_validate_untrustedRoot() throws {
65-
if !isSupportedPlatform {
66-
try XCTSkipIf(true)
67-
}
68-
6957
fixture(name: "Collections") { directoryPath in
7058
let certPath = directoryPath.appending(components: "Signing", "Test_rsa.cer")
7159
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -95,10 +83,6 @@ class CertificatePolicyTests: XCTestCase {
9583
}
9684

9785
func test_validate_expiredCert() throws {
98-
if !isSupportedPlatform {
99-
try XCTSkipIf(true)
100-
}
101-
10286
fixture(name: "Collections") { directoryPath in
10387
let certPath = directoryPath.appending(components: "Signing", "Test_rsa.cer")
10488
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -127,10 +111,6 @@ class CertificatePolicyTests: XCTestCase {
127111
try XCTSkipIf(true)
128112
#endif
129113

130-
if !isSupportedPlatform {
131-
try XCTSkipIf(true)
132-
}
133-
134114
fixture(name: "Collections") { directoryPath in
135115
let certPath = directoryPath.appending(components: "Signing", "development-revoked.cer")
136116
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -174,10 +154,6 @@ class CertificatePolicyTests: XCTestCase {
174154
try XCTSkipIf(true)
175155
#endif
176156

177-
if !isSupportedPlatform {
178-
try XCTSkipIf(true)
179-
}
180-
181157
fixture(name: "Collections") { directoryPath in
182158
let certPath = directoryPath.appending(components: "Signing", "development.cer")
183159
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -240,10 +216,6 @@ class CertificatePolicyTests: XCTestCase {
240216
try XCTSkipIf(true)
241217
#endif
242218

243-
if !isSupportedPlatform {
244-
try XCTSkipIf(true)
245-
}
246-
247219
fixture(name: "Collections") { directoryPath in
248220
// This must be an Apple Distribution cert
249221
let certPath = directoryPath.appending(components: "Signing", "development.cer")
@@ -307,10 +279,6 @@ class CertificatePolicyTests: XCTestCase {
307279
try XCTSkipIf(true)
308280
#endif
309281

310-
if !isSupportedPlatform {
311-
try XCTSkipIf(true)
312-
}
313-
314282
fixture(name: "Collections") { directoryPath in
315283
let certPath = directoryPath.appending(components: "Signing", "development.cer")
316284
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -346,10 +314,6 @@ class CertificatePolicyTests: XCTestCase {
346314
try XCTSkipIf(true)
347315
#endif
348316

349-
if !isSupportedPlatform {
350-
try XCTSkipIf(true)
351-
}
352-
353317
fixture(name: "Collections") { directoryPath in
354318
// This must be an Apple Distribution cert
355319
let certPath = directoryPath.appending(components: "Signing", "development.cer")

Tests/PackageCollectionsSigningTests/CertificateTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import TSCBasic
1717

1818
class CertificateTests: XCTestCase {
1919
func test_withRSAKey_fromDER() throws {
20-
if !isSupportedPlatform {
21-
try XCTSkipIf(true)
22-
}
23-
2420
fixture(name: "Collections") { directoryPath in
2521
let path = directoryPath.appending(components: "Signing", "Test_rsa.cer")
2622
let data = Data(try localFileSystem.readFileContents(path).contents)
@@ -42,10 +38,6 @@ class CertificateTests: XCTestCase {
4238
}
4339

4440
func test_withECKey_fromDER() throws {
45-
if !isSupportedPlatform {
46-
try XCTSkipIf(true)
47-
}
48-
4941
fixture(name: "Collections") { directoryPath in
5042
let path = directoryPath.appending(components: "Signing", "Test_ec.cer")
5143
let data = Data(try localFileSystem.readFileContents(path).contents)

Tests/PackageCollectionsSigningTests/KeyTests+EC.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import TSCBasic
1717

1818
class ECKeyTests: XCTestCase {
1919
func testPublicKeyFromCertificate() throws {
20-
if !isSupportedPlatform {
21-
try XCTSkipIf(true)
22-
}
23-
2420
fixture(name: "Collections") { directoryPath in
2521
let path = directoryPath.appending(components: "Signing", "Test_ec.cer")
2622
let data = Data(try localFileSystem.readFileContents(path).contents)

Tests/PackageCollectionsSigningTests/KeyTests+RSA.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import TSCBasic
1717

1818
class RSAKeyTests: XCTestCase {
1919
func testPublicKeyFromCertificate() throws {
20-
if !isSupportedPlatform {
21-
try XCTSkipIf(true)
22-
}
23-
2420
fixture(name: "Collections") { directoryPath in
2521
let path = directoryPath.appending(components: "Signing", "Test_rsa.cer")
2622
let data = Data(try localFileSystem.readFileContents(path).contents)
@@ -31,18 +27,10 @@ class RSAKeyTests: XCTestCase {
3127
}
3228

3329
func testPublicKeyFromPEM() throws {
34-
if !isSupportedPlatform {
35-
try XCTSkipIf(true)
36-
}
37-
3830
XCTAssertNoThrow(try RSAPublicKey(pem: rsaPublicKey.bytes))
3931
}
4032

4133
func testPrivateKeyFromPEM() throws {
42-
if !isSupportedPlatform {
43-
try XCTSkipIf(true)
44-
}
45-
4634
XCTAssertNoThrow(try RSAPrivateKey(pem: rsaPrivateKey.bytes))
4735
}
4836
}

Tests/PackageCollectionsSigningTests/PackageCollectionSigningTest.swift

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ import TSCBasic
1919

2020
class PackageCollectionSigningTests: XCTestCase {
2121
func test_RSA_signAndValidate_happyCase() throws {
22-
if !isSupportedPlatform {
23-
try XCTSkipIf(true)
24-
}
25-
2622
fixture(name: "Collections") { directoryPath in
2723
let jsonDecoder = JSONDecoder.makeWithDefaults()
2824

@@ -53,10 +49,6 @@ class PackageCollectionSigningTests: XCTestCase {
5349
}
5450

5551
func test_RSA_signAndValidate_collectionMismatch() throws {
56-
if !isSupportedPlatform {
57-
try XCTSkipIf(true)
58-
}
59-
6052
fixture(name: "Collections") { directoryPath in
6153
let collection1 = PackageCollectionModel.V1.Collection(
6254
name: "Test Package Collection 1",
@@ -111,10 +103,6 @@ class PackageCollectionSigningTests: XCTestCase {
111103
}
112104

113105
func test_EC_signAndValidate_happyCase() throws {
114-
if !isSupportedPlatform {
115-
try XCTSkipIf(true)
116-
}
117-
118106
fixture(name: "Collections") { directoryPath in
119107
let jsonDecoder = JSONDecoder.makeWithDefaults()
120108

@@ -145,10 +133,6 @@ class PackageCollectionSigningTests: XCTestCase {
145133
}
146134

147135
func test_EC_signAndValidate_collectionMismatch() throws {
148-
if !isSupportedPlatform {
149-
try XCTSkipIf(true)
150-
}
151-
152136
fixture(name: "Collections") { directoryPath in
153137
let collection1 = PackageCollectionModel.V1.Collection(
154138
name: "Test Package Collection 1",
@@ -208,10 +192,6 @@ class PackageCollectionSigningTests: XCTestCase {
208192
try XCTSkipIf(true)
209193
#endif
210194

211-
if !isSupportedPlatform {
212-
try XCTSkipIf(true)
213-
}
214-
215195
fixture(name: "Collections") { directoryPath in
216196
let jsonDecoder = JSONDecoder.makeWithDefaults()
217197

@@ -302,10 +282,6 @@ class PackageCollectionSigningTests: XCTestCase {
302282
try XCTSkipIf(true)
303283
#endif
304284

305-
if !isSupportedPlatform {
306-
try XCTSkipIf(true)
307-
}
308-
309285
fixture(name: "Collections") { directoryPath in
310286
let jsonDecoder = JSONDecoder.makeWithDefaults()
311287

@@ -397,10 +373,6 @@ class PackageCollectionSigningTests: XCTestCase {
397373
try XCTSkipIf(true)
398374
#endif
399375

400-
if !isSupportedPlatform {
401-
try XCTSkipIf(true)
402-
}
403-
404376
fixture(name: "Collections") { directoryPath in
405377
let jsonDecoder = JSONDecoder.makeWithDefaults()
406378

@@ -453,10 +425,6 @@ class PackageCollectionSigningTests: XCTestCase {
453425
try XCTSkipIf(true)
454426
#endif
455427

456-
if !isSupportedPlatform {
457-
try XCTSkipIf(true)
458-
}
459-
460428
fixture(name: "Collections") { directoryPath in
461429
let jsonDecoder = JSONDecoder.makeWithDefaults()
462430

Tests/PackageCollectionsSigningTests/SignatureTests.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import TSCBasic
1717

1818
class SignatureTests: XCTestCase {
1919
func test_RS256_generateAndValidate_happyCase() throws {
20-
if !isSupportedPlatform {
21-
try XCTSkipIf(true)
22-
}
23-
2420
fixture(name: "Collections") { directoryPath in
2521
let jsonEncoder = JSONEncoder()
2622
let jsonDecoder = JSONDecoder()
@@ -45,10 +41,6 @@ class SignatureTests: XCTestCase {
4541
}
4642

4743
func test_RS256_generateAndValidate_keyMismatch() throws {
48-
if !isSupportedPlatform {
49-
try XCTSkipIf(true)
50-
}
51-
5244
fixture(name: "Collections") { directoryPath in
5345
let jsonEncoder = JSONEncoder()
5446
let jsonDecoder = JSONDecoder()
@@ -76,10 +68,6 @@ class SignatureTests: XCTestCase {
7668
}
7769

7870
func test_ES256_generateAndValidate_happyCase() throws {
79-
if !isSupportedPlatform {
80-
try XCTSkipIf(true)
81-
}
82-
8371
fixture(name: "Collections") { directoryPath in
8472
let jsonEncoder = JSONEncoder()
8573
let jsonDecoder = JSONDecoder()
@@ -104,10 +92,6 @@ class SignatureTests: XCTestCase {
10492
}
10593

10694
func test_ES256_generateAndValidate_keyMismatch() throws {
107-
if !isSupportedPlatform {
108-
try XCTSkipIf(true)
109-
}
110-
11195
fixture(name: "Collections") { directoryPath in
11296
let jsonEncoder = JSONEncoder()
11397
let jsonDecoder = JSONDecoder()

Tests/PackageCollectionsSigningTests/SigningTests+RSAKey.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import XCTest
1515

1616
class RSAKeySigningTests: XCTestCase {
1717
func test_signAndValidate_happyCase() throws {
18-
if !isSupportedPlatform {
19-
try XCTSkipIf(true)
20-
}
21-
2218
let privateKey = try RSAPrivateKey(pem: rsaPrivateKey.bytes)
2319
let publicKey = try RSAPublicKey(pem: rsaPublicKey.bytes)
2420

@@ -28,10 +24,6 @@ class RSAKeySigningTests: XCTestCase {
2824
}
2925

3026
func test_signAndValidate_mismatch() throws {
31-
if !isSupportedPlatform {
32-
try XCTSkipIf(true)
33-
}
34-
3527
let privateKey = try RSAPrivateKey(pem: rsaPrivateKey.bytes)
3628
let publicKey = try RSAPublicKey(pem: rsaPublicKey.bytes)
3729

Tests/PackageCollectionsSigningTests/Utilities.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import Foundation
1414
@testable import PackageCollectionsSigning
1515
import TSCBasic
1616

17-
let isSupportedPlatform = true
18-
1917
// Update this when running ENABLE_REAL_CERT_TEST tests
2018
let expectedSubjectUserID = "<USER ID>"
2119

0 commit comments

Comments
 (0)