From c28cea3637ef9d965688f629c4aaae9f75484cb2 Mon Sep 17 00:00:00 2001 From: "John W. Bruce" Date: Thu, 19 Jul 2018 12:49:40 -0700 Subject: [PATCH] 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 --- libwvdrmengine/cdm/core/test/license_keys_unittest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/cdm/core/test/license_keys_unittest.cpp b/libwvdrmengine/cdm/core/test/license_keys_unittest.cpp index e97d3a9a..8ea902a1 100644 --- a/libwvdrmengine/cdm/core/test/license_keys_unittest.cpp +++ b/libwvdrmengine/cdm/core/test/license_keys_unittest.cpp @@ -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);