Skip to content

Commit a095731

Browse files
committed
Remove platform check in tests
1 parent 1948996 commit a095731

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
@@ -17,10 +17,6 @@ import TSCBasic
1717

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

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

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

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

129-
if !isSupportedPlatform {
130-
try XCTSkipIf(true)
131-
}
132-
133113
fixture(name: "Collections") { directoryPath in
134114
let certPath = directoryPath.appending(components: "Signing", "development-revoked.cer")
135115
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -171,10 +151,6 @@ class CertificatePolicyTests: XCTestCase {
171151
try XCTSkipIf(true)
172152
#endif
173153

174-
if !isSupportedPlatform {
175-
try XCTSkipIf(true)
176-
}
177-
178154
fixture(name: "Collections") { directoryPath in
179155
let certPath = directoryPath.appending(components: "Signing", "development.cer")
180156
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -208,10 +184,6 @@ class CertificatePolicyTests: XCTestCase {
208184
try XCTSkipIf(true)
209185
#endif
210186

211-
if !isSupportedPlatform {
212-
try XCTSkipIf(true)
213-
}
214-
215187
fixture(name: "Collections") { directoryPath in
216188
// This must be an Apple Distribution cert
217189
let certPath = directoryPath.appending(components: "Signing", "development.cer")
@@ -246,10 +218,6 @@ class CertificatePolicyTests: XCTestCase {
246218
try XCTSkipIf(true)
247219
#endif
248220

249-
if !isSupportedPlatform {
250-
try XCTSkipIf(true)
251-
}
252-
253221
fixture(name: "Collections") { directoryPath in
254222
let certPath = directoryPath.appending(components: "Signing", "development.cer")
255223
let certificate = try Certificate(derEncoded: Data(try localFileSystem.readFileContents(certPath).contents))
@@ -283,10 +251,6 @@ class CertificatePolicyTests: XCTestCase {
283251
try XCTSkipIf(true)
284252
#endif
285253

286-
if !isSupportedPlatform {
287-
try XCTSkipIf(true)
288-
}
289-
290254
fixture(name: "Collections") { directoryPath in
291255
// This must be an Apple Distribution cert
292256
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
@@ -18,10 +18,6 @@ import TSCBasic
1818

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

@@ -52,10 +48,6 @@ class PackageCollectionSigningTests: XCTestCase {
5248
}
5349

5450
func test_RSA_signAndValidate_collectionMismatch() throws {
55-
if !isSupportedPlatform {
56-
try XCTSkipIf(true)
57-
}
58-
5951
fixture(name: "Collections") { directoryPath in
6052
let collection1 = PackageCollectionModel.V1.Collection(
6153
name: "Test Package Collection 1",
@@ -110,10 +102,6 @@ class PackageCollectionSigningTests: XCTestCase {
110102
}
111103

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

@@ -144,10 +132,6 @@ class PackageCollectionSigningTests: XCTestCase {
144132
}
145133

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

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

@@ -263,10 +243,6 @@ class PackageCollectionSigningTests: XCTestCase {
263243
try XCTSkipIf(true)
264244
#endif
265245

266-
if !isSupportedPlatform {
267-
try XCTSkipIf(true)
268-
}
269-
270246
fixture(name: "Collections") { directoryPath in
271247
let jsonDecoder = JSONDecoder.makeWithDefaults()
272248

@@ -320,10 +296,6 @@ class PackageCollectionSigningTests: XCTestCase {
320296
try XCTSkipIf(true)
321297
#endif
322298

323-
if !isSupportedPlatform {
324-
try XCTSkipIf(true)
325-
}
326-
327299
fixture(name: "Collections") { directoryPath in
328300
let jsonDecoder = JSONDecoder.makeWithDefaults()
329301

@@ -376,10 +348,6 @@ class PackageCollectionSigningTests: XCTestCase {
376348
try XCTSkipIf(true)
377349
#endif
378350

379-
if !isSupportedPlatform {
380-
try XCTSkipIf(true)
381-
}
382-
383351
fixture(name: "Collections") { directoryPath in
384352
let jsonDecoder = JSONDecoder.makeWithDefaults()
385353

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
@@ -12,8 +12,6 @@ import Foundation
1212

1313
@testable import PackageCollectionsSigning
1414

15-
let isSupportedPlatform = true
16-
1715
// Update this when running ENABLE_REAL_CERT_TEST tests
1816
let expectedSubjectUserID = "<USER ID>"
1917

0 commit comments

Comments
 (0)