Skip to content

Commit c69fea9

Browse files
committed
Remove Int128 tests for now
Most people are not yet using a toolchain with support for Int128; we'll re-enable these when we bump the baseline to Swift 6.0
1 parent 3ee0781 commit c69fea9

File tree

2 files changed

+0
-68
lines changed

2 files changed

+0
-68
lines changed

Tests/IntegerUtilitiesTests/DivideTests.swift

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -467,44 +467,6 @@ final class IntegerUtilitiesDivideTests: XCTestCase {
467467
}
468468
}
469469

470-
@available(macOS 15, iOS 18, tvOS 18, watchOS 11, visionOS 2, *)
471-
func divideUInt64(_ a: UInt64, _ b: UInt64, rounding rule: RoundingRule) {
472-
let expected = UInt64(Int128(a).divided(by: Int128(b), rounding: rule).quotient)
473-
let observed = a.divided(by: b, rounding: rule)
474-
guard expected == observed else {
475-
XCTFail("""
476-
\(a).divided(by: \(b), rounding: \(rule)) did not match expected result:
477-
Computed with Int128: \(expected)
478-
Computed with UInt64: \(observed)
479-
""")
480-
return
481-
}
482-
}
483-
484-
@available(macOS 15, iOS 18, tvOS 18, watchOS 11, visionOS 2, *)
485-
func testDivideUInt64() {
486-
var values = [UInt64](repeating: 0, count: 64)
487-
for i in 0 ..< values.count {
488-
while values[i] == 0 {
489-
values[i] = .random(in: .min ... .max)
490-
}
491-
}
492-
for a in values {
493-
for b in values where b != 0 {
494-
divideUInt64(a, b, rounding: .down)
495-
divideUInt64(a, b, rounding: .up)
496-
divideUInt64(a, b, rounding: .towardZero)
497-
divideUInt64(a, b, rounding: .awayFromZero)
498-
divideUInt64(a, b, rounding: .toNearestOrDown)
499-
divideUInt64(a, b, rounding: .toNearestOrUp)
500-
divideUInt64(a, b, rounding: .toNearestOrZero)
501-
divideUInt64(a, b, rounding: .toNearestOrAway)
502-
divideUInt64(a, b, rounding: .toNearestOrEven)
503-
divideUInt64(a, b, rounding: .toOdd)
504-
}
505-
}
506-
}
507-
508470
// stochastically rounding doesn't have a deterministic "expected" answer,
509471
// but we know that the result must be either the floor or the ceiling.
510472
// The above tests ensure that, but that's not a very strong guarantee;

Tests/IntegerUtilitiesTests/ShiftTests.swift

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -167,32 +167,6 @@ final class IntegerUtilitiesShiftTests: XCTestCase {
167167
testRoundingShift(UInt.self, rounding: .toNearestOrEven)
168168
testRoundingShift(UInt.self, rounding: .toOdd)
169169
testRoundingShift(UInt.self, rounding: .stochastically)
170-
171-
if #available(macOS 15, iOS 18, tvOS 18, watchOS 11, visionOS 2, *) {
172-
testRoundingShift(Int128.self, rounding: .down)
173-
testRoundingShift(Int128.self, rounding: .up)
174-
testRoundingShift(Int128.self, rounding: .towardZero)
175-
testRoundingShift(Int128.self, rounding: .awayFromZero)
176-
testRoundingShift(Int128.self, rounding: .toNearestOrUp)
177-
testRoundingShift(Int128.self, rounding: .toNearestOrDown)
178-
testRoundingShift(Int128.self, rounding: .toNearestOrZero)
179-
testRoundingShift(Int128.self, rounding: .toNearestOrAway)
180-
testRoundingShift(Int128.self, rounding: .toNearestOrEven)
181-
testRoundingShift(Int128.self, rounding: .toOdd)
182-
testRoundingShift(Int128.self, rounding: .stochastically)
183-
184-
testRoundingShift(UInt128.self, rounding: .down)
185-
testRoundingShift(UInt128.self, rounding: .up)
186-
testRoundingShift(UInt128.self, rounding: .towardZero)
187-
testRoundingShift(UInt128.self, rounding: .awayFromZero)
188-
testRoundingShift(UInt128.self, rounding: .toNearestOrUp)
189-
testRoundingShift(UInt128.self, rounding: .toNearestOrDown)
190-
testRoundingShift(UInt128.self, rounding: .toNearestOrZero)
191-
testRoundingShift(UInt128.self, rounding: .toNearestOrAway)
192-
testRoundingShift(UInt128.self, rounding: .toNearestOrEven)
193-
testRoundingShift(UInt128.self, rounding: .toOdd)
194-
testRoundingShift(UInt128.self, rounding: .stochastically)
195-
}
196170
}
197171

198172
// Stochastic rounding doesn't have a deterministic "expected" answer,
@@ -247,10 +221,6 @@ final class IntegerUtilitiesShiftTests: XCTestCase {
247221
testStochasticAverage(UInt32.random(in: .min ... .max))
248222
testStochasticAverage(Int64.random(in: .min ... .max))
249223
testStochasticAverage(UInt64.random(in: .min ... .max))
250-
if #available(macOS 15, iOS 18, tvOS 18, watchOS 11, visionOS 2, *) {
251-
testStochasticAverage(Int128.random(in: .min ... .max))
252-
testStochasticAverage(UInt128.random(in: .min ... .max))
253-
}
254224
testStochasticAverage(DoubleWidth<Int64>.random(in: .min ... .max))
255225
testStochasticAverage(DoubleWidth<UInt64>.random(in: .min ... .max))
256226
}

0 commit comments

Comments
 (0)