Add Missing Parameter to License Keys Unit-Test
(This is a merge of http://go/wvgerrit/55265) Compiling with GCC 7 revealed that a function call in this test was missing an argument. It meant to be passing the output protection level to the function, but because of optional arguments, it was instead passing it as the fourth argument. Fixing this revealed that the test cases for the test were incorrect in one case, which has been fixed to expect the correct results. Thankfully, this part of the code does not appear to have been broken while the tests had this hole. Bug: 111648438 Test: build_and_run_all_unit_tests.sh Change-Id: I6c13d5fecdccc4185ca5e8698fc845929ff16cb1
This commit is contained in:
@@ -290,7 +290,7 @@ class LicenseKeysTest : public ::testing::Test {
|
||||
|
||||
constraints.clear();
|
||||
AddConstraint(constraints, key_lo_res_min, key_lo_res_max);
|
||||
AddConstraint(constraints, key_hi_res_min, key_hi_res_max,
|
||||
AddConstraint(constraints, key_hi_res_min, key_hi_res_max, true,
|
||||
KeyContainer::OutputProtection::HDCP_NO_DIGITAL_OUTPUT);
|
||||
|
||||
AddContentKey(ck_NO_HDCP_dual_res, true, KeyContainer::HW_SECURE_ALL, true,
|
||||
@@ -789,12 +789,12 @@ TEST_F(LicenseKeysTest, ConstraintChanges) {
|
||||
EXPECT_FALSE(license_keys_.CanDecryptContent(ck_NO_HDCP_lo_res));
|
||||
EXPECT_TRUE(license_keys_.CanDecryptContent(ck_HDCP_NO_OUTPUT_hi_res));
|
||||
EXPECT_FALSE(license_keys_.CanDecryptContent(ck_HDCP_V2_1_max_res));
|
||||
EXPECT_TRUE(license_keys_.CanDecryptContent(ck_NO_HDCP_dual_res));
|
||||
EXPECT_FALSE(license_keys_.CanDecryptContent(ck_NO_HDCP_dual_res));
|
||||
|
||||
EXPECT_FALSE(license_keys_.MeetsConstraints(ck_NO_HDCP_lo_res));
|
||||
EXPECT_TRUE(license_keys_.MeetsConstraints(ck_HDCP_NO_OUTPUT_hi_res));
|
||||
EXPECT_FALSE(license_keys_.MeetsConstraints(ck_HDCP_V2_1_max_res));
|
||||
EXPECT_TRUE(license_keys_.MeetsConstraints(ck_NO_HDCP_dual_res));
|
||||
EXPECT_FALSE(license_keys_.MeetsConstraints(ck_NO_HDCP_dual_res));
|
||||
|
||||
license_keys_.ExtractKeyStatuses(&key_status_map);
|
||||
ExpectKeyStatusEqual(key_status_map, ck_sw_crypto_NO_HDCP, kKeyStatusUsable);
|
||||
|
||||
Reference in New Issue
Block a user