Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Remove tests which create undefined behavior.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 624909243
  • Loading branch information
tholenst authored and copybara-github committed Apr 15, 2024
1 parent 735315f commit b8f7f7c
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions cc/util/enums_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ TEST_F(EnumsTest, testEllipticCurveType) {
Enums::SubtleToProto(subtle::EllipticCurveType::CURVE25519));
EXPECT_EQ(pb::EllipticCurveType::UNKNOWN_CURVE,
Enums::SubtleToProto(subtle::EllipticCurveType::UNKNOWN_CURVE));
EXPECT_EQ(pb::EllipticCurveType::UNKNOWN_CURVE,
Enums::SubtleToProto((subtle::EllipticCurveType)42));

EXPECT_EQ(subtle::EllipticCurveType::NIST_P256,
Enums::ProtoToSubtle(pb::EllipticCurveType::NIST_P256));
Expand All @@ -59,8 +57,6 @@ TEST_F(EnumsTest, testEllipticCurveType) {
Enums::ProtoToSubtle(pb::EllipticCurveType::CURVE25519));
EXPECT_EQ(subtle::EllipticCurveType::UNKNOWN_CURVE,
Enums::ProtoToSubtle(pb::EllipticCurveType::UNKNOWN_CURVE));
EXPECT_EQ(subtle::EllipticCurveType::UNKNOWN_CURVE,
Enums::ProtoToSubtle((pb::EllipticCurveType)42));

// Check that enum conversion covers the entire range of the proto-enum.
int count = 0;
Expand All @@ -87,8 +83,6 @@ TEST_F(EnumsTest, testHashType) {
Enums::SubtleToProto(subtle::HashType::SHA512));
EXPECT_EQ(pb::HashType::UNKNOWN_HASH,
Enums::SubtleToProto(subtle::HashType::UNKNOWN_HASH));
EXPECT_EQ(pb::HashType::UNKNOWN_HASH,
Enums::SubtleToProto((subtle::HashType)42));

EXPECT_EQ(subtle::HashType::SHA1, Enums::ProtoToSubtle(pb::HashType::SHA1));
EXPECT_EQ(subtle::HashType::SHA224,
Expand All @@ -101,8 +95,6 @@ TEST_F(EnumsTest, testHashType) {
Enums::ProtoToSubtle(pb::HashType::SHA512));
EXPECT_EQ(subtle::HashType::UNKNOWN_HASH,
Enums::ProtoToSubtle(pb::HashType::UNKNOWN_HASH));
EXPECT_EQ(subtle::HashType::UNKNOWN_HASH,
Enums::ProtoToSubtle((pb::HashType)42));

// Check that enum conversion covers the entire range of the proto-enum.
int count = 0;
Expand Down Expand Up @@ -147,8 +139,6 @@ TEST_F(EnumsTest, testEcPointFormat) {
Enums::ProtoToSubtle(pb::EcPointFormat::COMPRESSED));
EXPECT_EQ(subtle::EcPointFormat::UNKNOWN_FORMAT,
Enums::ProtoToSubtle(pb::EcPointFormat::UNKNOWN_FORMAT));
EXPECT_EQ(subtle::EcPointFormat::UNKNOWN_FORMAT,
Enums::ProtoToSubtle((pb::EcPointFormat)42));

// Check that enum conversion covers the entire range of the proto-enum.
int count = 0;
Expand Down Expand Up @@ -202,8 +192,6 @@ TEST_F(EnumsTest, testKeyStatusName) {
EXPECT_EQ(
"UNKNOWN_STATUS",
std::string(Enums::KeyStatusName(pb::KeyStatusType::UNKNOWN_STATUS)));
EXPECT_EQ("UNKNOWN_STATUS",
std::string(Enums::KeyStatusName((pb::KeyStatusType)42)));

EXPECT_EQ(pb::KeyStatusType::ENABLED, Enums::KeyStatus("ENABLED"));
EXPECT_EQ(pb::KeyStatusType::DISABLED, Enums::KeyStatus("DISABLED"));
Expand Down

0 comments on commit b8f7f7c

Please sign in to comment.