Modify OEMCrypto unit tests to allow 16.3 or 16.4

Merge from Widevine repo of http://go/wvgerrit/121790

Some unit tests expected OEMCrypto to be the latest ODK version,
but we do not require this for v16.

Bug: 184905579
Change-Id: Iccdbcc0b28587aad79a2a63d8c39a564a47fb585
This commit is contained in:
Fred Gylys-Colwell
2021-04-10 11:14:18 -07:00
parent 6628c7f693
commit ef65e86ee2

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