Skip to content
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
4 changes: 2 additions & 2 deletions Sources/XCTest/Private/PerformanceMeter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public final class PerformanceMeter {
let meter = PerformanceMeter(metrics: metrics, delegate: delegate, file: file, line: line)
meter.measure(block)
} catch let e {
delegate.recordAPIViolation(description: String(e), file: file, line: line)
delegate.recordAPIViolation(description: String(describing: e), file: file, line: line)
}
}

Expand Down Expand Up @@ -204,6 +204,6 @@ public final class PerformanceMeter {

private func recordAPIViolation(_ error: Error, file: StaticString, line: UInt) {
state = .measurementAborted
delegate.recordAPIViolation(description: String(error), file: file, line: line)
delegate.recordAPIViolation(description: String(describing: error), file: file, line: line)
}
}
2 changes: 1 addition & 1 deletion Sources/XCTest/Private/TestListing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension XCTestSuite: Listable {
}

private var listingName: String {
if let childTestCase = tests.first as? XCTestCase, name == String(childTestCase.dynamicType) {
if let childTestCase = tests.first as? XCTestCase, name == String(describing: childTestCase.dynamicType) {
return "\(moduleName(value: childTestCase)).\(name)"
} else {
return name
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTest/Private/XCTestCaseSuite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal class XCTestCaseSuite: XCTestSuite {
init(testCaseEntry: XCTestCaseEntry) {
let testCaseClass = testCaseEntry.testCaseClass
self.testCaseClass = testCaseClass
super.init(name: String(testCaseClass))
super.init(name: String(describing: testCaseClass))

for (testName, testClosure) in testCaseEntry.allTests {
let testCase = testCaseClass.init(name: testName, testClosure: testClosure)
Expand Down
2 changes: 1 addition & 1 deletion Sources/XCTest/Public/XCTAssert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private func _XCTEvaluateAssertion(_ assertion: _XCTAssertion, message: @autoclo
if let currentTestCase = XCTCurrentTestCase {
currentTestCase.recordFailure(
withDescription: "\(result.failureDescription(assertion)) - \(message())",
inFile: String(file),
inFile: String(describing: file),
atLine: line,
expected: result.isExpected)
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/XCTest/Public/XCTestCase+Asynchronous.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public extension XCTestCase {
if _allExpectations.count == 0 {
recordFailure(
withDescription: "API violation - call made to wait without any expectations having been set.",
inFile: String(file),
inFile: String(describing: file),
atLine: line,
expected: false)
return
Expand Down Expand Up @@ -129,7 +129,7 @@ public extension XCTestCase {
let descriptions = unfulfilledDescriptions.joined(separator: ", ")
recordFailure(
withDescription: "Asynchronous wait failed - Exceeded timeout of \(timeout) seconds, with unfulfilled expectations: \(descriptions)",
inFile: String(file),
inFile: String(describing: file),
atLine: line,
expected: true)
}
Expand Down Expand Up @@ -248,7 +248,7 @@ internal extension XCTestCase {
if expectations.count > 0 {
recordFailure(
withDescription: "Failed due to unwaited expectations.",
inFile: String(expectations.last!.file),
inFile: String(describing: expectations.last!.file),
atLine: expectations.last!.line,
expected: false)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/XCTest/Public/XCTestCase+Performance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public extension XCTestCase {
extension XCTestCase: PerformanceMeterDelegate {
internal func recordAPIViolation(description: String, file: StaticString, line: UInt) {
recordFailure(withDescription: "API violation - \(description)",
inFile: String(file),
inFile: String(describing: file),
atLine: line,
expected: false)
}
Expand All @@ -161,6 +161,6 @@ extension XCTestCase: PerformanceMeterDelegate {
}

internal func recordFailure(description: String, file: StaticString, line: UInt) {
recordFailure(withDescription: "failed: " + description, inFile: String(file), atLine: line, expected: true)
recordFailure(withDescription: "failed: " + description, inFile: String(describing: file), atLine: line, expected: true)
}
}
2 changes: 1 addition & 1 deletion Sources/XCTest/Public/XCTestExpectation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class XCTestExpectation {
if let testCase = XCTCurrentTestCase {
testCase.recordFailure(
withDescription: "API violation - multiple calls made to XCTestExpectation.fulfill() for \(description).",
inFile: String(file),
inFile: String(describing: file),
atLine: line,
expected: false)
}
Expand Down