Skip to content

Commit 493d37e

Browse files
authored
[cxx-interop] Fix hashable-enums test (#77053)
The hash of enum values are different from that of their underlying rawValue due to the implementation details of Int on 64-bit platform which are not true on 32-bit platforms. This commit removes the tests that rely on this behavior. rdar://138032645
1 parent 65b2bee commit 493d37e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

test/Interop/Cxx/enum/hashable-enums.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,11 @@ HashableEnumsTestSuite.test("Untyped enums hash using underlying value") {
6262
}
6363
}
6464

65-
HashableEnumsTestSuite.test("Typed enums and class enums hash using other info") {
66-
// The raw values of these enum members are known:
65+
HashableEnumsTestSuite.test("Raw values are well-defined") {
6766
expectEqual(kRed.rawValue, 0)
6867
expectEqual(kYellow.rawValue, 10)
6968
expectEqual(Pet.goat.rawValue, 5)
7069
expectEqual(Pet.cat.rawValue, 15)
71-
72-
// But the Hashable implementation uses more than the raw value to compute the hash:
73-
expectNotEqual(getHash(kRed), getHash(0))
74-
expectNotEqual(getHash(kYellow), getHash(10))
75-
expectNotEqual(getHash(Pet.goat), getHash(5))
76-
expectNotEqual(getHash(Pet.cat), getHash(15))
7770
}
7871

7972
HashableEnumsTestSuite.test("Sets work as expected") {

0 commit comments

Comments
 (0)