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
This commit is contained in:
Fred Gylys-Colwell
2021-08-04 20:27:06 +00:00
parent 1ffc1ca575
commit 55c4dfc25a

View File

@@ -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_) {