Skip to content

Commit 1f36fda

Browse files
committed
[cxx-interop] Use the right assertion function in tests
`assert`s get stripped away in release builds. To make sure the checks in tests still run in release builds, this switches to `expectTrue`/`expectFalse` instead of `assert`.
1 parent ab43437 commit 1f36fda

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/Interop/Cxx/foreign-reference/inheritance.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ var TemplatingTestSuite = TestSuite("Foreign references work with templates")
1616

1717
TemplatingTestSuite.test("SubT") {
1818
let s: SubT = SubT.getSubT()
19-
assert(!s.isBase)
19+
expectFalse(s.isBase)
2020
let sc: BaseT = cast(s)
21-
assert(!sc.isBase)
21+
expectFalse(sc.isBase)
2222
let sx: BaseT = cxxCast(s) // should instantiate I to SubT and O to BaseT
23-
assert(!sc.isBase)
23+
expectFalse(sc.isBase)
2424
}
2525

2626
TemplatingTestSuite.test("BaseT") {
2727
let b: BaseT = BaseT.getBaseT()
28-
assert(b.isBase)
28+
expectTrue(b.isBase)
2929
let bc: BaseT = cxxCast(b) // should instantiate I and O both to BaseT
30-
assert(bc.isBase)
30+
expectTrue(bc.isBase)
3131
}
3232

3333
runAllTests()

0 commit comments

Comments
 (0)