Skip to content

[validation-test] Fix Swift 3 warnings in .gyb (NFC) #1270

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 1 commit into from
Feb 11, 2016
Merged
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
20 changes: 10 additions & 10 deletions validation-test/stdlib/FixedPointArithmeticTraps.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func expectOverflow<T>(
@autoclosure _ message: () -> String = "",
showFrame: Bool = true,
stackTrace: SourceLocStack = SourceLocStack(),
file: String = __FILE__, line: UInt = __LINE__
file: String = #file, line: UInt = #line
) {
expectTrue(
res.overflow, "expected overflow",
Expand All @@ -41,7 +41,7 @@ func expectNoOverflow<T>(
@autoclosure _ message: () -> String = "",
showFrame: Bool = true,
stackTrace: SourceLocStack = SourceLocStack(),
file: String = __FILE__, line: UInt = __LINE__
file: String = #file, line: UInt = #line
) {
expectFalse(
res.overflow, "expected no overflow",
Expand All @@ -68,45 +68,45 @@ var FixedPointArithmeticTraps = TestSuite("FixedPointArithmeticTraps")

FixedPointArithmeticTraps.test("PreDecrement/${IntTy}") {
var x = get${IntTy}(${IntTy}.min)
++x
x += 1

x = get${IntTy}(${IntTy}.min)
expectCrashLater()
// --IntTy.min
--x
x -= 1
_blackHole(x)
}

FixedPointArithmeticTraps.test("PreIncrement/${IntTy}") {
var x = get${IntTy}(${IntTy}.max)
--x
x -= 1

x = get${IntTy}(${IntTy}.max)
expectCrashLater()
// ++IntTy.max
++x
x += 1
_blackHole(x)
}

FixedPointArithmeticTraps.test("PostDecrement/${IntTy}") {
var x = get${IntTy}(${IntTy}.min)
x++
x += 1

x = get${IntTy}(${IntTy}.min)
expectCrashLater()
// IntTy.min--
x--
x -= 1
_blackHole(x)
}

FixedPointArithmeticTraps.test("PostIncrement/${IntTy}") {
var x = get${IntTy}(${IntTy}.max)
x--
x -= 1

x = get${IntTy}(${IntTy}.max)
expectCrashLater()
// IntTy.max++
x++
x += 1
_blackHole(x)
}

Expand Down