From b07523f4c6323d9c9a12e3e6b6dd70dcde22d028 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Mon, 21 Mar 2022 14:41:01 -0700 Subject: [PATCH] Constrain the generated key type in testing [ Merge of http://go/wvgerrit/148157 ] Fail the test if the returned type is other values. Bug: 224375138 Test: GtsMediaDrmTests Change-Id: I4abad9d69865cac99654d3dedd443463dd728a58 --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index cb27efc5..0141bb64 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -1340,6 +1340,8 @@ TEST_F(OEMCryptoProv40Test, GenerateCertificateKeyPairSuccess) { } else if (key_type == OEMCrypto_PrivateKeyType::OEMCrypto_ECC_Private_Key) { ASSERT_NO_FATAL_FAILURE( s.SetEcPublicKey(public_key.data(), public_key_size)); + } else { + FAIL() << "Unknown private key type: " << static_cast(key_type); } }