Skip to content

Commit 0424234

Browse files
author
Max Moiseev
committed
[test] Fix validation tests
(cherry picked from commit 5da3e1d)
1 parent a138cca commit 0424234

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

validation-test/stdlib/FixedPoint.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ FixedPoint.test("BitwiseOperations/UInt64") {
327327
}
328328

329329
FixedPoint.test("OverflowCheck") {
330-
expectEqual((partialValue: 9, overflow: .none),
330+
expectEqual((partialValue: 9, overflow: false),
331331
(4 as Int8).addingReportingOverflow(5))
332-
expectEqual((partialValue: -128, overflow: .overflow),
332+
expectEqual((partialValue: -128, overflow: true),
333333
(1 as Int8).addingReportingOverflow(127))
334-
expectEqual((partialValue: 0, overflow: .overflow),
334+
expectEqual((partialValue: 0, overflow: true),
335335
(2 as UInt8).multipliedReportingOverflow(by: 128))
336336
}
337337

validation-test/stdlib/FixedPointArithmeticTraps.swift.gyb

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,6 @@ import StdlibUnittest
1515
// constants. This is to check runtime behavior and ensure the constant is
1616
// not folded.
1717

18-
func expectOverflow<T>(
19-
_ res: (T, overflow: Bool),
20-
//===--- TRACE boilerplate ----------------------------------------------===//
21-
_ message: @autoclosure () -> String = "",
22-
showFrame: Bool = true,
23-
stackTrace: SourceLocStack = SourceLocStack(),
24-
file: String = #file, line: UInt = #line
25-
) {
26-
expectTrue(
27-
res.overflow, "expected overflow",
28-
stackTrace: stackTrace.pushIf(showFrame, file: file, line: line))
29-
}
30-
31-
func expectNoOverflow<T>(
32-
_ res: (T, overflow: Bool),
33-
//===--- TRACE boilerplate ----------------------------------------------===//
34-
_ message: @autoclosure () -> String = "",
35-
showFrame: Bool = true,
36-
stackTrace: SourceLocStack = SourceLocStack(),
37-
file: String = #file, line: UInt = #line
38-
) {
39-
expectFalse(
40-
res.overflow, "expected no overflow",
41-
stackTrace: stackTrace.pushIf(showFrame, file: file, line: line))
42-
}
43-
4418
func expectOverflow<T>(
4519
_ res: (partialValue: T, overflow: Bool),
4620
//===--- TRACE boilerplate ----------------------------------------------===//

0 commit comments

Comments
 (0)