Skip to content

Commit 203dc55

Browse files
committed
[benchmark] CheckResults → check
Capitalizing function names is against Swift naming conventions.
1 parent a723e6d commit 203dc55

File tree

104 files changed

+386
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+386
-373
lines changed

benchmark/multi-source/PrimsSplit/Prims_main.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,6 @@ public func run_PrimsSplit(_ N: Int) {
556556
for i in 1..<treeEdges.count {
557557
if let n = treeEdges[i] { cost += map[Edge(start: n, end: i)]! }
558558
}
559-
CheckResults(Int(cost) == 49324)
559+
check(Int(cost) == 49324)
560560
}
561561
}

benchmark/single-source/Ackermann.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ public func run_Ackermann(_ N: Int) {
4747
break
4848
}
4949
}
50-
CheckResults(result == ref_result[n])
50+
check(result == ref_result[n])
5151
}

benchmark/single-source/ArrayLiteral.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public func run_ArrayValueProp(_ N: Int) {
4848
res += addLiteralArray()
4949
res -= addLiteralArray()
5050
}
51-
CheckResults(res == 123)
51+
check(res == 123)
5252
}
5353

5454

@@ -89,7 +89,7 @@ public func run_ArrayValueProp2(_ N: Int) {
8989
res += addLiteralArray2()
9090
res -= addLiteralArray2()
9191
}
92-
CheckResults(res == 123)
92+
check(res == 123)
9393
}
9494

9595
@inline(never)
@@ -99,7 +99,7 @@ public func run_ArrayValueProp3(_ N: Int) {
9999
res += addLiteralArray3()
100100
res -= addLiteralArray3()
101101
}
102-
CheckResults(res == 123)
102+
check(res == 123)
103103
}
104104

105105
@inline(never)
@@ -109,5 +109,5 @@ public func run_ArrayValueProp4(_ N: Int) {
109109
res += addLiteralArray4()
110110
res -= addLiteralArray4()
111111
}
112-
CheckResults(res == 123)
112+
check(res == 123)
113113
}

benchmark/single-source/ArraySubscript.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public func run_ArraySubscript(_ N: Int) {
4141
arrays[i][bound(i)] =
4242
max(arrays[i-1][bound(i-1)], arrays[i][bound(i)])
4343
}
44-
CheckResults(arrays[0][0] <= arrays[numArrays-1][bound(numArrays-1)])
44+
check(arrays[0][0] <= arrays[numArrays-1][bound(numArrays-1)])
4545
}
4646
}

benchmark/single-source/BinaryFloatingPointConversionFromBinaryInteger.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public func run_BinaryFloatingPointConversionFromBinaryInteger(_ N: Int) {
206206
}
207207
xs.append(x)
208208
}
209-
CheckResults(xs[getInt(0)] == 1999000)
209+
check(xs[getInt(0)] == 1999000)
210210
}
211211

212212
#endif

benchmark/single-source/BinaryFloatingPointProperties.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public func run_BinaryFloatingPointPropertiesBinade(_ N: Int) {
4141
}
4242
xs.append(x)
4343
}
44-
CheckResults(xs[getInt(0)] == 37180757)
44+
check(xs[getInt(0)] == 37180757)
4545
}
4646

4747
@inline(never)
@@ -55,7 +55,7 @@ public func run_BinaryFloatingPointPropertiesNextUp(_ N: Int) {
5555
}
5656
xs.append(x)
5757
}
58-
CheckResults(xs[getInt(0)] == 49995000)
58+
check(xs[getInt(0)] == 49995000)
5959
}
6060

6161
@inline(never)
@@ -69,5 +69,5 @@ public func run_BinaryFloatingPointPropertiesUlp(_ N: Int) {
6969
}
7070
xs.append(x)
7171
}
72-
CheckResults(xs[getInt(0)] == 0)
72+
check(xs[getInt(0)] == 0)
7373
}

benchmark/single-source/BitCount.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ public func run_BitCount(_ N: Int) {
4242
&+ countBitSet(getInt(2))
4343
&+ countBitSet(getInt(2457))
4444
}
45-
CheckResults(sum == 8 * 1000 * N)
45+
check(sum == 8 * 1000 * N)
4646
}

benchmark/single-source/BucketSort.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ func run_BucketSort(_ N : Int) {
126126
for _ in 0..<N {
127127
let sortedArray = bucketSort(
128128
items, sortingAlgorithm: InsertionSort(), bucketArray: buckets)
129-
CheckResults(isAscending(sortedArray))
129+
check(isAscending(sortedArray))
130130
}
131131
}

benchmark/single-source/BufferFill.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public func bufferFillFromSliceExecute(n: Int) {
6161
let slice = Slice(base: a, bounds: a.indices)
6262
var (iterator, copied) = b.initialize(from: slice)
6363
blackHole(b)
64-
CheckResults(copied == a.count && iterator.next() == nil)
64+
check(copied == a.count && iterator.next() == nil)
6565
}
6666

67-
CheckResults(a[r] == b[r])
67+
check(a[r] == b[r])
6868
}
6969

7070
var ra: [UInt8] = []
@@ -94,7 +94,7 @@ public func rawBufferCopyBytesExecute(n: Int) {
9494
blackHole(rb)
9595
}
9696

97-
CheckResults(ra[r] == rb[r])
97+
check(ra[r] == rb[r])
9898
}
9999

100100
public func rawBufferInitializeMemorySetup() {
@@ -117,12 +117,12 @@ public func rawBufferInitializeMemoryExecute(n: Int) {
117117
for _ in 0..<n {
118118
var (iterator, initialized) = rb.initializeMemory(as: Int.self, from: a)
119119
blackHole(rb)
120-
CheckResults(initialized.count == a.count && iterator.next() == nil)
120+
check(initialized.count == a.count && iterator.next() == nil)
121121
}
122122

123123
let offset = rb.baseAddress!.advanced(by: r*MemoryLayout<Int>.stride)
124124
let value = offset.load(as: Int.self)
125-
CheckResults(value == a[r])
125+
check(value == a[r])
126126
}
127127

128128
var r8: UnsafeRawBufferPointer = .init(start: nil, count: 0)
@@ -159,8 +159,8 @@ public func rawBufferCopyContentsExecute(n: Int) {
159159
for _ in 0..<n {
160160
var (iterator, initialized) = b8.initialize(from: r8)
161161
blackHole(b8)
162-
CheckResults(initialized == r8.count && iterator.next() == nil)
162+
check(initialized == r8.count && iterator.next() == nil)
163163
}
164164

165-
CheckResults(b8[r] == r8[r])
165+
check(b8[r] == r8[r])
166166
}

benchmark/single-source/ByteSwap.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ public func run_ByteSwap(_ N: Int) {
5353
&+ byteswap_logn(byteswap_n(x &+ 9129))
5454
&+ byteswap_logn(byteswap_n(x &+ 3333))
5555
}
56-
CheckResults(s == (2457 &+ 9129 &+ 3333) &* 10000 &* N)
56+
check(s == (2457 &+ 9129 &+ 3333) &* 10000 &* N)
5757
}

benchmark/single-source/COWTree.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public func run_COWTree(_ N: Int) {
3131
}
3232
}
3333

34-
CheckResults(checkRef(tree1, tree2, tree3))
34+
check(checkRef(tree1, tree2, tree3))
3535
}
3636

3737
@inline(never)

benchmark/single-source/CSVParsing.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ public func buildWorkload() {
346346
let altIndices: [[String]] = contents.parseAltIndices().map {
347347
$0.map { String($0) }
348348
}
349-
CheckResults(alt.elementsEqual(altIndices))
349+
check(alt.elementsEqual(altIndices))
350350

351351
var remainder = workload[...]
352352

@@ -359,7 +359,7 @@ public func buildWorkload() {
359359
res[res.endIndex-1].append(field)
360360
}
361361
}
362-
CheckResults(alt.elementsEqual(parseResult))
362+
check(alt.elementsEqual(parseResult))
363363
}
364364

365365
@inline(never)

benchmark/single-source/CString.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public func run_CStringLongAscii(_ N: Int) {
4747
// static string to c -> from c to String -> implicit conversion
4848
res &= strlen(ascii.withCString(String.init(cString:)))
4949
}
50-
CheckResults(res == 0)
50+
check(res == 0)
5151
}
5252

5353
@inline(never)
@@ -56,7 +56,7 @@ public func run_CStringLongNonAscii(_ N: Int) {
5656
for _ in 1...N*500 {
5757
res &= strlen(japanese.withCString(String.init(cString:)))
5858
}
59-
CheckResults(res == 0)
59+
check(res == 0)
6060
}
6161

6262

@@ -94,5 +94,5 @@ public func run_CStringShortAscii(_ N: Int) {
9494
}
9595
res = res & DoOneIter(strings)
9696
}
97-
CheckResults(res == reference)
97+
check(res == reference)
9898
}

benchmark/single-source/Calculator.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ public func run_Calculator(_ N: Int) {
5050
c += my_atoi_impl(identity("10"))
5151
c -= 45
5252
}
53-
CheckResults(c == 0)
53+
check(c == 0)
5454
}

benchmark/single-source/ChaCha.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ public let ChaCha = BenchmarkInfo(
350350

351351
@inline(never)
352352
func checkResult(_ plaintext: [UInt8]) {
353-
CheckResults(plaintext.first! == 6 && plaintext.last! == 254)
353+
check(plaintext.first! == 6 && plaintext.last! == 254)
354354
var hash: UInt64 = 0
355355
for byte in plaintext {
356356
// rotate
357357
hash = (hash &<< 8) | (hash &>> (64 - 8))
358358
hash ^= UInt64(byte)
359359
}
360-
CheckResults(hash == 0xa1bcdb217d8d14e4)
360+
check(hash == 0xa1bcdb217d8d14e4)
361361
}
362362

363363
@inline(never)

benchmark/single-source/ChainedFilterMap.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public func run_ChainedFilterMap(_ N: Int) {
2323
result = numbers.reduce(into: 0) { $0 += $1 }
2424
}
2525

26-
CheckResults(result == 416691666)
26+
check(result == 416691666)
2727
}
2828

2929
@inline(never)
@@ -40,5 +40,5 @@ public func run_FatCompactMap(_ N: Int) {
4040
}
4141
result = numbers.reduce(into: 0) { $0 += $1 }
4242
}
43-
CheckResults(result == 416691666)
43+
check(result == 416691666)
4444
}

benchmark/single-source/Combos.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public func run_Combos(_ N: Int) {
2727
}
2828
}
2929

30-
CheckResults(combos.first! == firstRef && combos.last! == lastRef)
30+
check(combos.first! == firstRef && combos.last! == lastRef)
3131
}
3232

3333
func combinations

benchmark/single-source/DeadArray.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ public func run_DeadArray(_ N: Int) {
4242
Count = 0
4343
runLoop(0, var2: 0)
4444
}
45-
CheckResults(Count == 500)
45+
check(Count == 500)
4646
}

benchmark/single-source/DictOfArraysToArrayOfDicts.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public func run_DictOfArraysToArrayOfDicts(_ N: Int) {
3939
}
4040
}
4141

42-
CheckResults(arrayOfDicts.count == 3)
42+
check(arrayOfDicts.count == 3)
4343
}
4444

4545
// Given [

benchmark/single-source/DictTest.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public func run_Dictionary(N: Int) {
144144
dict[word] = true
145145
}
146146
}
147-
CheckResults(dict.count == 270)
147+
check(dict.count == 270)
148148

149149
// Check performance of searching in the dictionary:
150150
dict = half
@@ -157,7 +157,7 @@ public func run_Dictionary(N: Int) {
157157
}
158158
}
159159
}
160-
CheckResults(count == N*541)
160+
check(count == N*541)
161161
}
162162

163163
class Box<T : Hashable> : Hashable {
@@ -197,7 +197,7 @@ public func run_DictionaryOfObjects(N: Int) {
197197
dict[Box(word)] = Box(true)
198198
}
199199
}
200-
CheckResults(dict.count == 270)
200+
check(dict.count == 270)
201201

202202
// Check performance of searching in the dictionary:
203203
dict = halfObjects
@@ -210,5 +210,5 @@ public func run_DictionaryOfObjects(N: Int) {
210210
}
211211
}
212212
}
213-
CheckResults(count == N*541)
213+
check(count == N*541)
214214
}

benchmark/single-source/DictTest2.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public func run_Dictionary2(_ N: Int) {
4545
break
4646
}
4747
}
48-
CheckResults(res == ref_result)
48+
check(res == ref_result)
4949
}
5050

5151
class Box<T : Hashable> : Hashable {
@@ -87,5 +87,5 @@ public func run_Dictionary2OfObjects(_ N: Int) {
8787
break
8888
}
8989
}
90-
CheckResults(res == ref_result)
90+
check(res == ref_result)
9191
}

benchmark/single-source/DictTest3.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public func run_Dictionary3(_ N: Int) {
4646
break
4747
}
4848
}
49-
CheckResults(res == ref_result)
49+
check(res == ref_result)
5050
}
5151

5252
class Box<T : Hashable> : Hashable {
@@ -94,5 +94,5 @@ public func run_Dictionary3OfObjects(_ N: Int) {
9494
break
9595
}
9696
}
97-
CheckResults(res == ref_result)
97+
check(res == ref_result)
9898
}

benchmark/single-source/DictTest4.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public func run_Dictionary4(_ N: Int) {
8181
break
8282
}
8383
}
84-
CheckResults(res == ref_result)
84+
check(res == ref_result)
8585
}
8686

8787
class Box<T : Hashable> : Hashable {
@@ -131,5 +131,5 @@ public func run_Dictionary4OfObjects(_ N: Int) {
131131
break
132132
}
133133
}
134-
CheckResults(res == ref_result)
134+
check(res == ref_result)
135135
}

benchmark/single-source/DictTest4Legacy.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public func run_Dictionary4Legacy(_ N: Int) {
104104
break
105105
}
106106
}
107-
CheckResults(res == ref_result)
107+
check(res == ref_result)
108108
}
109109

110110
class Box<T : Hashable> : Hashable {
@@ -158,5 +158,5 @@ public func run_Dictionary4OfObjectsLegacy(_ N: Int) {
158158
break
159159
}
160160
}
161-
CheckResults(res == ref_result)
161+
check(res == ref_result)
162162
}

benchmark/single-source/DictionaryBridge.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Thing : NSObject {
2626

2727
required override init() {
2828
let c = type(of: self).col()
29-
CheckResults(c!.count == 10)
29+
check(c!.count == 10)
3030
}
3131

3232
private class func col() -> [String : AnyObject]? {

0 commit comments

Comments
 (0)