From 55c4dfc25a178d0cb253c5a40e34ed5f737f949a Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Wed, 4 Aug 2021 20:27:06 +0000 Subject: [PATCH] Modify OEMCrypto unit tests to allow 16.3 or 16.4 Some unit tests expected OEMCrypto to be the latest ODK version, but we do not require this for v16. Bug: 184905579 --- oemcrypto/test/oec_session_util.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/oemcrypto/test/oec_session_util.cpp b/oemcrypto/test/oec_session_util.cpp index 6af0136..243c798 100644 --- a/oemcrypto/test/oec_session_util.cpp +++ b/oemcrypto/test/oec_session_util.cpp @@ -502,9 +502,13 @@ void LicenseRoundTrip::FillAndVerifyCoreRequest( oemcrypto_core_message::deserialize::CoreLicenseRequestFromMessage( core_message_string, &core_request_)); EXPECT_EQ(global_features.api_version, core_request_.api_major_version); - // If we are testing the latest OEMCrypto version, make sure it is built with - // the latest ODK version, too: - if (global_features.api_version == ODK_MAJOR_VERSION) { + if (global_features.api_version == 16) { + // We support either 16.3 or 16.4 for OEMCrypto 16. + EXPECT_LE(3, core_request_.api_minor_version); + EXPECT_GE(4, core_request_.api_minor_version); + } else if (global_features.api_version == ODK_MAJOR_VERSION) { + // If we are testing the latest OEMCrypto version, make sure it is built + // with the latest ODK version, too: EXPECT_EQ(ODK_MINOR_VERSION, core_request_.api_minor_version); } if (expect_request_has_correct_nonce_) {