Skip to content

tests: fix some tests for enabling OSSA modules #78943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/ClangImporter/enum-error-execute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,23 @@ func testError() {
assert(false)
}

// TODO: re-enable this test once rdar://143681997 is fixed.
// The problem is that TestErrorDomain (a NSString pointer) is null, but it's not imported as Optional<NSString>.
/*
do {
throw NSError(domain: TestErrorDomain,
code: Int(TestError.TENone.rawValue),
userInfo: nil)
} catch let error as TestError {
printError(error)
// CHECK-NEXT: TestError: TENone
// TODO: when re-enabling this test change back to CHECK-NEXT
// CHECK-NOT: TestError: TENone
} catch _ as NSError {
print("nserror")
} catch {
assert(false)
}
*/

do {
enum LocalError : Error { case Err }
Expand Down
8 changes: 7 additions & 1 deletion test/Interpreter/lifetime_nonmutating_address_only.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ extension SomeProtocol {
}
}

SomeClass().someProperty.x = 32
func testit() {
let c = SomeClass()
c.someProperty.x = 32
}

testit()

1 change: 1 addition & 0 deletions validation-test/stdlib/Arrays.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let CopyToNativeArrayBufferTests = TestSuite("CopyToNativeArrayBufferTests")

extension Array {
func _rawIdentifier() -> Int {
_blackHole(self)
return unsafeBitCast(self, to: Int.self)
}
}
Expand Down
5 changes: 4 additions & 1 deletion validation-test/stdlib/ErrorHandling.swift
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@ ErrorHandlingTests.test("ErrorHandling/Sequence filter") {
let initialCount = NoisyCount
for condition in [true, false] {
for throwAtCount in 0...3 {
let sequence = [Noisy(), Noisy(), Noisy()]
let n1 = Noisy()
let n2 = Noisy()
let n3 = Noisy()
let sequence = [n1, n2, n3]
var loopCount = 0
do {
let result: [Noisy] = try sequence.filter { _ in
Expand Down
1 change: 1 addition & 0 deletions validation-test/stdlib/Set.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Foundation

extension Set {
func _rawIdentifier() -> Int {
_blackHole(self)
return unsafeBitCast(self, to: Int.self)
}
}
Expand Down
3 changes: 2 additions & 1 deletion validation-test/stdlib/SetAnyHashableExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ SetTests.test("insert<Hashable>(_:)/CastTrap")
}

expectCrashLater()
_ = s.insert(TestHashableDerivedB(1010, identity: 3))
let (_, old) = s.insert(TestHashableDerivedB(1010, identity: 3))
_blackHole(old)
}

SetTests.test("update<Hashable>(with:)") {
Expand Down