Skip to content

Commit e97ed13

Browse files
committed
reduce testsuite dependence on the Boolean protocol.
1 parent 66961fc commit e97ed13

File tree

4 files changed

+10
-70
lines changed

4 files changed

+10
-70
lines changed

test/1_stdlib/DarwinAPI.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ DarwinBooleanAPI.test("boolValue/extra values") {
4949

5050
DarwinBooleanAPI.test("Boolean") {
5151
var trueValue: DarwinBoolean = true
52-
expectIsBooleanType(&trueValue)
5352

5453
var success = false
55-
if trueValue {
54+
if trueValue.boolValue {
5655
success = true
5756
} else {
5857
expectUnreachable()
@@ -89,20 +88,20 @@ DarwinBooleanAPI.test("&&") {
8988
let trueValue: DarwinBoolean = true
9089
let falseValue: DarwinBoolean = false
9190

92-
expectTrue(trueValue && trueValue)
93-
expectFalse(trueValue && falseValue)
94-
expectFalse(falseValue && trueValue)
95-
expectFalse(falseValue && falseValue)
91+
expectTrue(trueValue.boolValue && trueValue.boolValue)
92+
expectFalse(trueValue.boolValue && falseValue.boolValue)
93+
expectFalse(falseValue.boolValue && trueValue.boolValue)
94+
expectFalse(falseValue.boolValue && falseValue.boolValue)
9695
}
9796

9897
DarwinBooleanAPI.test("||") {
9998
let trueValue: DarwinBoolean = true
10099
let falseValue: DarwinBoolean = false
101100

102-
expectTrue(trueValue || trueValue)
103-
expectTrue(trueValue || falseValue)
104-
expectTrue(falseValue || trueValue)
105-
expectFalse(falseValue || falseValue)
101+
expectTrue(trueValue.boolValue || trueValue.boolValue)
102+
expectTrue(trueValue.boolValue || falseValue.boolValue)
103+
expectTrue(falseValue.boolValue || trueValue.boolValue)
104+
expectFalse(falseValue.boolValue || falseValue.boolValue)
106105
}
107106

108107
var DarwinIoctlConstants = TestSuite("DarwinIoctlConstants")

test/1_stdlib/LogicValue.swift

Lines changed: 0 additions & 51 deletions
This file was deleted.

test/Interpreter/SDK/equatable_hashable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test_CBool()
1818

1919
func test_ObjCBool() {
2020
let x = ObjCBool(true)
21-
let hash = testHash(Bool(x))
21+
let hash = testHash(x.boolValue)
2222
print("ObjCBool: hash = \(hash)")
2323
}
2424
// CHECK-NEXT: ObjCBool: hash = 1

test/decl/overload.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,6 @@ func != <T>(lhs : T, rhs : NoneType) -> Bool { // expected-error{{invalid redecl
217217
return true
218218
}
219219

220-
// <rdar://problem/15082356>
221-
func &&(lhs: Boolean, rhs: @autoclosure () -> Boolean) -> Bool { // expected-note{{previously declared}}
222-
return lhs.boolValue && rhs().boolValue
223-
}
224-
225-
func &&(lhs: Boolean, rhs: @autoclosure () -> Boolean) -> Bool { // expected-error{{invalid redeclaration of '&&'}}
226-
return lhs.boolValue || rhs().boolValue
227-
}
228220

229221
// throws
230222
func throwsFunc(code: Int) { } // expected-note{{previously declared}}

0 commit comments

Comments
 (0)