Google-style override & virtual
(This is a merge of http://go/wvgerrit/66625) Google C++ Style dictates that methods which override base class or interface methods should be declared "override" but not "virtual". Since our codebase has not had access to "override" until now, many of our classes do not follow this rule. I've updated as many places as I could find to follow Google C++ Style, which should hopefully help us catch errors better in the future. Bug: 111851141 Test: CE CDM Unit Tests Test: Android Unit Tests Change-Id: Ic23e2e482e967256da306791532b5fec7b81b2f2
This commit is contained in:
@@ -18,38 +18,38 @@ class ContentKeySession : public KeySession {
|
||||
: KeySession(metrics),
|
||||
oec_session_id_(oec_session_id),
|
||||
cipher_mode_(kCipherModeCtr) {}
|
||||
virtual ~ContentKeySession() {}
|
||||
~ContentKeySession() override {}
|
||||
|
||||
virtual KeySessionType Type() override { return kDefault; }
|
||||
KeySessionType Type() override { return kDefault; }
|
||||
|
||||
// Generate Derived Keys for ContentKeySession
|
||||
virtual bool GenerateDerivedKeys(const std::string& message) override;
|
||||
bool GenerateDerivedKeys(const std::string& message) override;
|
||||
|
||||
// Generate Derived Keys (from session key) for ContentKeySession
|
||||
virtual bool GenerateDerivedKeys(const std::string& message,
|
||||
const std::string& session_key) override;
|
||||
bool GenerateDerivedKeys(const std::string& message,
|
||||
const std::string& session_key) override;
|
||||
|
||||
// Load Keys for ContentKeySession
|
||||
virtual OEMCryptoResult LoadKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::string& mac_key_iv,
|
||||
const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& keys,
|
||||
const std::string& provider_session_token,
|
||||
CdmCipherMode* cipher_mode,
|
||||
const std::string& srm_requirement) override;
|
||||
OEMCryptoResult LoadKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::string& mac_key_iv,
|
||||
const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& keys,
|
||||
const std::string& provider_session_token,
|
||||
CdmCipherMode* cipher_mode,
|
||||
const std::string& srm_requirement) override;
|
||||
|
||||
virtual OEMCryptoResult LoadEntitledContentKeys(
|
||||
OEMCryptoResult LoadEntitledContentKeys(
|
||||
const std::vector<CryptoKey>&) override {
|
||||
return OEMCrypto_ERROR_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
// Select Key for ContentKeySession
|
||||
virtual OEMCryptoResult SelectKey(const std::string& key_id,
|
||||
CdmCipherMode cipher_mode) override;
|
||||
OEMCryptoResult SelectKey(const std::string& key_id,
|
||||
CdmCipherMode cipher_mode) override;
|
||||
|
||||
// Decrypt for ContentKeySession
|
||||
virtual OEMCryptoResult Decrypt(
|
||||
OEMCryptoResult Decrypt(
|
||||
const CdmDecryptionParameters& params,
|
||||
OEMCrypto_DestBufferDesc& buffer_descriptor,
|
||||
OEMCrypto_CENCEncryptPatternDesc& pattern_descriptor) override;
|
||||
@@ -60,8 +60,7 @@ class ContentKeySession : public KeySession {
|
||||
const std::string& mac_key_iv, const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& keys,
|
||||
const std::string& provider_session_token, CdmCipherMode* cipher_mode,
|
||||
const std::string& srm_requirement,
|
||||
OEMCrypto_LicenseType license_type);
|
||||
const std::string& srm_requirement, OEMCrypto_LicenseType license_type);
|
||||
|
||||
CryptoSessionId oec_session_id_;
|
||||
|
||||
|
||||
@@ -19,23 +19,23 @@ class EntitlementKeySession : public ContentKeySession {
|
||||
public:
|
||||
EntitlementKeySession(CryptoSessionId oec_session_id,
|
||||
metrics::CryptoMetrics* metrics);
|
||||
virtual ~EntitlementKeySession() {}
|
||||
~EntitlementKeySession() override {}
|
||||
|
||||
KeySessionType Type() { return kEntitlement; }
|
||||
|
||||
// Load Keys for ContentKeySession
|
||||
virtual OEMCryptoResult LoadKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::string& mac_key_iv,
|
||||
const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& keys,
|
||||
const std::string& provider_session_token,
|
||||
CdmCipherMode* cipher_mode,
|
||||
const std::string& srm_requirement) override;
|
||||
virtual OEMCryptoResult LoadEntitledContentKeys(
|
||||
OEMCryptoResult LoadKeys(const std::string& message,
|
||||
const std::string& signature,
|
||||
const std::string& mac_key_iv,
|
||||
const std::string& mac_key,
|
||||
const std::vector<CryptoKey>& keys,
|
||||
const std::string& provider_session_token,
|
||||
CdmCipherMode* cipher_mode,
|
||||
const std::string& srm_requirement) override;
|
||||
OEMCryptoResult LoadEntitledContentKeys(
|
||||
const std::vector<CryptoKey>& keys) override;
|
||||
virtual OEMCryptoResult SelectKey(const std::string& key_id,
|
||||
CdmCipherMode cipher_mode) override;
|
||||
OEMCryptoResult SelectKey(const std::string& key_id,
|
||||
CdmCipherMode cipher_mode) override;
|
||||
|
||||
private:
|
||||
// The message is populated with the fields of the provided CryptoKey and the
|
||||
|
||||
@@ -34,21 +34,21 @@ namespace wvcdm {
|
||||
class UsagePropertySet : public CdmClientPropertySet {
|
||||
public:
|
||||
UsagePropertySet() {}
|
||||
virtual ~UsagePropertySet() {}
|
||||
~UsagePropertySet() override {}
|
||||
void set_security_level(SecurityLevel security_level) {
|
||||
if (kLevel3 == security_level)
|
||||
security_level_ = QUERY_VALUE_SECURITY_LEVEL_L3;
|
||||
else
|
||||
security_level_.clear();
|
||||
}
|
||||
virtual const std::string& security_level() const { return security_level_; }
|
||||
virtual bool use_privacy_mode() const { return false; }
|
||||
virtual const std::string& service_certificate() const { return empty_; }
|
||||
virtual void set_service_certificate(const std::string&) {}
|
||||
virtual bool is_session_sharing_enabled() const { return false; }
|
||||
virtual uint32_t session_sharing_id() const { return 0; }
|
||||
virtual void set_session_sharing_id(uint32_t /* id */) {}
|
||||
virtual const std::string& app_id() const { return app_id_; }
|
||||
const std::string& security_level() const override { return security_level_; }
|
||||
bool use_privacy_mode() const override { return false; }
|
||||
const std::string& service_certificate() const override { return empty_; }
|
||||
void set_service_certificate(const std::string&) override {}
|
||||
bool is_session_sharing_enabled() const override { return false; }
|
||||
uint32_t session_sharing_id() const override { return 0; }
|
||||
void set_session_sharing_id(uint32_t /* id */) override {}
|
||||
const std::string& app_id() const override { return app_id_; }
|
||||
void set_app_id(const std::string& appId) { app_id_ = appId; }
|
||||
|
||||
private:
|
||||
|
||||
@@ -48,9 +48,9 @@ class WvCdmEnginePreProvTest : public WvCdmTestBase {
|
||||
WvCdmEnginePreProvTest()
|
||||
: cdm_engine_(&file_system_), session_opened_(false) {}
|
||||
|
||||
virtual ~WvCdmEnginePreProvTest() {}
|
||||
~WvCdmEnginePreProvTest() override {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
session_opened_ = false;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class WvCdmEnginePreProvTest : public WvCdmTestBase {
|
||||
session_opened_ = true;
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
if (cdm_engine_.IsProvisioned(kSecurityLevelL1)) {
|
||||
cdm_engine_.Unprovision(kSecurityLevelL1);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ class WvCdmEngineTest : public WvCdmEnginePreProvTest {
|
||||
public:
|
||||
WvCdmEngineTest() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
session_opened_ = false;
|
||||
WvCdmEnginePreProvTest::OpenSession();
|
||||
|
||||
@@ -172,7 +172,7 @@ class MockCdmLicense : public CdmLicense {
|
||||
|
||||
class CdmSessionTest : public WvCdmTestBase {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
cdm_session_.reset(new CdmSession(NULL, &metrics_));
|
||||
// Inject testing mocks.
|
||||
@@ -186,7 +186,7 @@ class CdmSessionTest : public WvCdmTestBase {
|
||||
cdm_session_->set_file_handle(file_handle_);
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
// Force the cdm_session_ to be deleted. This enforces a requirement that
|
||||
// the CDM session metrics exist at least as long as the CDM session.
|
||||
cdm_session_.reset();
|
||||
|
||||
@@ -2006,7 +2006,7 @@ using ::testing::StrEq;
|
||||
|
||||
class DeviceFilesTest : public ::testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
ASSERT_TRUE(Properties::GetDeviceFilesBasePath(kSecurityLevelL1,
|
||||
&device_base_path_));
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class FileTest : public testing::Test {
|
||||
protected:
|
||||
FileTest() {}
|
||||
|
||||
virtual void TearDown() { RemoveTestDir(); }
|
||||
void TearDown() override { RemoveTestDir(); }
|
||||
|
||||
void RemoveTestDir() {
|
||||
EXPECT_TRUE(file_system.Remove(test_vectors::kTestDir));
|
||||
|
||||
@@ -34,7 +34,7 @@ class WvGenericOperationsTest : public WvCdmTestBase {
|
||||
WvGenericOperationsTest()
|
||||
: cdm_engine_(&file_system_), holder_(&cdm_engine_) {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
EnsureProvisioned();
|
||||
holder_.OpenSession(config_.key_system());
|
||||
@@ -61,7 +61,7 @@ class WvGenericOperationsTest : public WvCdmTestBase {
|
||||
iv_ = std::string(iv_vector_.begin(), iv_vector_.end());
|
||||
}
|
||||
|
||||
virtual void TearDown() { holder_.CloseSession(); }
|
||||
void TearDown() override { holder_.CloseSession(); }
|
||||
|
||||
// Create a single key, and add it to the license.
|
||||
void AddOneKey(const KeyId& key_id, const std::vector<uint8_t>& key_data,
|
||||
|
||||
@@ -97,7 +97,7 @@ class LicenseKeysTest : public ::testing::Test {
|
||||
static const KeyFlag kContentClearFalse = kKeyFlagFalse;
|
||||
static const KeyFlag kContentClearTrue = kKeyFlagTrue;
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
LicenseIdentification* id = license_.mutable_id();
|
||||
id->set_version(1);
|
||||
id->set_type(STREAMING);
|
||||
|
||||
@@ -207,7 +207,7 @@ class CdmLicenseTest : public WvCdmTestBase {
|
||||
protected:
|
||||
CdmLicenseTest(const std::string& pssh = (kCencInitDataHdr + kCencPssh))
|
||||
: pssh_(pssh) {}
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
clock_ = new MockClock();
|
||||
crypto_session_ = new MockCryptoSession(&crypto_metrics_);
|
||||
@@ -219,7 +219,7 @@ class CdmLicenseTest : public WvCdmTestBase {
|
||||
DoAll(SetArgPointee<0>(kDefaultSupportedCertTypes), Return(true)));
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
if (cdm_license_) delete cdm_license_;
|
||||
if (policy_engine_) delete policy_engine_;
|
||||
if (init_data_) delete init_data_;
|
||||
|
||||
@@ -92,7 +92,7 @@ class PolicyEngineConstraintsTest : public WvCdmTestBase {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
current_time_ = 0;
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class PolicyEngineTest : public WvCdmTestBase {
|
||||
PolicyEngineTest() : crypto_session_(&dummy_metrics_) {
|
||||
}
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
policy_engine_.reset(
|
||||
new PolicyEngine(kSessionId, &mock_event_listener_,
|
||||
@@ -1927,7 +1927,7 @@ TEST_F(PolicyEngineKeyAllowedUsageTest, AllowedUsageGeneric) {
|
||||
|
||||
class PolicyEngineQueryTest : public PolicyEngineTest {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
PolicyEngineTest::SetUp();
|
||||
policy_engine_.reset(new PolicyEngine(kSessionId, NULL, &crypto_session_));
|
||||
InjectMockClock();
|
||||
|
||||
@@ -57,27 +57,27 @@ class StubCdmClientPropertySet : public CdmClientPropertySet {
|
||||
session_sharing_id_(0),
|
||||
app_id_(kAppId) {}
|
||||
|
||||
virtual const std::string& security_level() const { return security_level_; }
|
||||
const std::string& security_level() const override { return security_level_; }
|
||||
|
||||
virtual bool use_privacy_mode() const { return use_privacy_mode_; }
|
||||
bool use_privacy_mode() const override { return use_privacy_mode_; }
|
||||
|
||||
virtual const std::string& service_certificate() const {
|
||||
const std::string& service_certificate() const override {
|
||||
return raw_service_certificate_;
|
||||
}
|
||||
|
||||
virtual void set_service_certificate(const std::string& cert) {
|
||||
void set_service_certificate(const std::string& cert) override {
|
||||
raw_service_certificate_ = cert;
|
||||
}
|
||||
|
||||
virtual bool is_session_sharing_enabled() const {
|
||||
bool is_session_sharing_enabled() const override {
|
||||
return is_session_sharing_enabled_;
|
||||
}
|
||||
|
||||
virtual uint32_t session_sharing_id() const { return session_sharing_id_; }
|
||||
uint32_t session_sharing_id() const override { return session_sharing_id_; }
|
||||
|
||||
virtual void set_session_sharing_id(uint32_t id) { session_sharing_id_ = id; }
|
||||
void set_session_sharing_id(uint32_t id) override { session_sharing_id_ = id; }
|
||||
|
||||
virtual const std::string& app_id() const { return app_id_; }
|
||||
const std::string& app_id() const override { return app_id_; }
|
||||
|
||||
void enable_privacy_mode() { use_privacy_mode_ = true; }
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace wvcdm {
|
||||
class WvCdmTestBase : public ::testing::Test {
|
||||
public:
|
||||
WvCdmTestBase() : config_(default_config_), binary_provisioning_(false) {}
|
||||
virtual ~WvCdmTestBase() {}
|
||||
virtual void SetUp();
|
||||
~WvCdmTestBase() override {}
|
||||
void SetUp() override;
|
||||
virtual std::string binary_key_id() const { return a2bs_hex(config_.key_id()); }
|
||||
|
||||
// Returns true if the test program should continue, if false, the caller
|
||||
|
||||
@@ -264,7 +264,7 @@ class UsageTableHeaderTest : public WvCdmTestBase {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
WvCdmTestBase::SetUp();
|
||||
// UsageTableHeader will take ownership of the pointer
|
||||
device_files_ = new MockDeviceFiles();
|
||||
@@ -276,7 +276,7 @@ class UsageTableHeaderTest : public WvCdmTestBase {
|
||||
usage_table_header_->SetCryptoSession(crypto_session_);
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
if (usage_table_header_ != NULL) delete usage_table_header_;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Key {
|
||||
Key(const std::vector<uint8_t>& key_string, const KeyControlBlock& control)
|
||||
: value_(key_string), control_(control), ctr_mode_(true){};
|
||||
|
||||
virtual ~Key(){};
|
||||
virtual ~Key() {};
|
||||
void UpdateDuration(const KeyControlBlock& control);
|
||||
virtual const std::vector<uint8_t>& value() const { return value_; }
|
||||
const KeyControlBlock& control() const { return control_; }
|
||||
@@ -65,8 +65,8 @@ class Key {
|
||||
class EntitlementKey : public Key {
|
||||
public:
|
||||
EntitlementKey(const Key& key) : Key(key) {}
|
||||
virtual ~EntitlementKey() {}
|
||||
virtual const std::vector<uint8_t>& value() const { return content_key_; }
|
||||
~EntitlementKey() override {}
|
||||
const std::vector<uint8_t>& value() const override { return content_key_; }
|
||||
const std::vector<uint8_t>& content_key() { return content_key_; }
|
||||
const std::vector<uint8_t>& content_key_id() { return content_key_id_; }
|
||||
const std::vector<uint8_t>& entitlement_key() { return Key::value(); }
|
||||
|
||||
@@ -55,20 +55,20 @@ namespace wvoec_ref {
|
||||
class ContentKeysContext : public SessionContextKeys {
|
||||
public:
|
||||
explicit ContentKeysContext() {}
|
||||
virtual ~ContentKeysContext() {}
|
||||
virtual size_t size() { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data);
|
||||
virtual Key* Find(const KeyId& key_id);
|
||||
virtual void Remove(const KeyId& key_id);
|
||||
virtual void UpdateDuration(const KeyControlBlock& control);
|
||||
~ContentKeysContext() override {}
|
||||
size_t size() override { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data) override;
|
||||
Key* Find(const KeyId& key_id) override;
|
||||
void Remove(const KeyId& key_id) override;
|
||||
void UpdateDuration(const KeyControlBlock& control) override;
|
||||
|
||||
virtual OEMCrypto_LicenseType type() { return OEMCrypto_ContentLicense; }
|
||||
OEMCrypto_LicenseType type() override { return OEMCrypto_ContentLicense; }
|
||||
|
||||
virtual bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key);
|
||||
virtual bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** entitlement_key);
|
||||
bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key) override;
|
||||
bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** entitlement_key) override;
|
||||
|
||||
private:
|
||||
SessionKeyTable session_keys_;
|
||||
@@ -109,19 +109,19 @@ bool ContentKeysContext::GetEntitlementKey(const KeyId& entitlement_id,
|
||||
class EntitlementKeysContext : public SessionContextKeys {
|
||||
public:
|
||||
EntitlementKeysContext() {}
|
||||
virtual ~EntitlementKeysContext() {}
|
||||
virtual size_t size() { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data);
|
||||
virtual Key* Find(const KeyId& key_id);
|
||||
virtual void Remove(const KeyId& key_id);
|
||||
virtual void UpdateDuration(const KeyControlBlock& control);
|
||||
virtual bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key);
|
||||
virtual bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** key);
|
||||
~EntitlementKeysContext() override {}
|
||||
size_t size() override { return session_keys_.size(); }
|
||||
bool Insert(const KeyId& key_id, const Key& key_data) override;
|
||||
Key* Find(const KeyId& key_id) override;
|
||||
void Remove(const KeyId& key_id) override;
|
||||
void UpdateDuration(const KeyControlBlock& control) override;
|
||||
bool SetContentKey(const KeyId& entitlement_id,
|
||||
const KeyId& content_key_id,
|
||||
const std::vector<uint8_t>& content_key) override;
|
||||
bool GetEntitlementKey(const KeyId& entitlement_id,
|
||||
const std::vector<uint8_t>** key) override;
|
||||
|
||||
virtual OEMCrypto_LicenseType type() { return OEMCrypto_EntitlementLicense; }
|
||||
OEMCrypto_LicenseType type() override { return OEMCrypto_EntitlementLicense; }
|
||||
|
||||
private:
|
||||
EntitlementKeyTable session_keys_;
|
||||
|
||||
@@ -90,7 +90,7 @@ class OEMCryptoClientTest : public ::testing::Test, public SessionUtil {
|
||||
protected:
|
||||
OEMCryptoClientTest() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
::testing::Test::SetUp();
|
||||
wvcdm::g_cutoff = wvcdm::LOG_INFO;
|
||||
const ::testing::TestInfo* const test_info =
|
||||
@@ -100,7 +100,7 @@ class OEMCryptoClientTest : public ::testing::Test, public SessionUtil {
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_Initialize());
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
OEMCrypto_Terminate();
|
||||
::testing::Test::TearDown();
|
||||
}
|
||||
@@ -492,7 +492,7 @@ TEST_F(OEMCryptoClientTest, CanLoadTestKeys) {
|
||||
}
|
||||
|
||||
class OEMCryptoKeyboxTest : public OEMCryptoClientTest {
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoClientTest::SetUp();
|
||||
OEMCryptoResult sts = OEMCrypto_IsKeyboxValid();
|
||||
// If the production keybox is valid, use it for these tests. Most of the
|
||||
@@ -710,7 +710,7 @@ class OEMCryptoSessionTests : public OEMCryptoClientTest {
|
||||
protected:
|
||||
OEMCryptoSessionTests() {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoClientTest::SetUp();
|
||||
EnsureTestKeys();
|
||||
if (global_features.usage_table) {
|
||||
@@ -738,7 +738,7 @@ class OEMCryptoSessionTests : public OEMCryptoClientTest {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
// If we installed a bad keybox, end with a good one installed.
|
||||
if (global_features.derive_key_method == DeviceFeatures::FORCE_TEST_KEYBOX)
|
||||
InstallKeybox(kTestKeybox, true);
|
||||
@@ -1294,7 +1294,7 @@ TEST_F(OEMCryptoSessionTests, LoadKeyUnalignedMessage) {
|
||||
class SessionTestAlternateVerification : public OEMCryptoSessionTests,
|
||||
public WithParamInterface<int> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoSessionTests::SetUp();
|
||||
target_api_ = static_cast<uint32_t>(GetParam());
|
||||
}
|
||||
@@ -1569,7 +1569,7 @@ class SessionTestRefreshKeyTest
|
||||
: public OEMCryptoSessionTests,
|
||||
public WithParamInterface<std::pair<bool, int> > {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoSessionTests::SetUp();
|
||||
new_mac_keys_ =
|
||||
GetParam().first; // Whether to put new mac keys in LoadKeys.
|
||||
@@ -1831,7 +1831,7 @@ class OEMCryptoSessionTestsDecryptTests
|
||||
public WithParamInterface<tuple<OEMCrypto_CENCEncryptPatternDesc,
|
||||
OEMCryptoCipherMode, bool> > {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoSessionTests::SetUp();
|
||||
pattern_ = ::testing::get<0>(GetParam());
|
||||
cipher_mode_ = ::testing::get<1>(GetParam());
|
||||
@@ -2789,7 +2789,7 @@ TEST_F(OEMCryptoLoadsCertificate, SupportsCertificatesAPI13) {
|
||||
|
||||
class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoLoadsCertificate::SetUp();
|
||||
ASSERT_NO_FATAL_FAILURE(session_.open());
|
||||
if (global_features.derive_key_method !=
|
||||
@@ -2802,7 +2802,7 @@ class OEMCryptoUsesCertificate : public OEMCryptoLoadsCertificate {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
session_.close();
|
||||
OEMCryptoLoadsCertificate::TearDown();
|
||||
}
|
||||
@@ -4067,14 +4067,14 @@ class GenericCryptoTest : public OEMCryptoSessionTests {
|
||||
// reasonable number of blocks for most of the tests.
|
||||
GenericCryptoTest() : buffer_size_(160) {}
|
||||
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCryptoSessionTests::SetUp();
|
||||
ASSERT_NO_FATAL_FAILURE(session_.open());
|
||||
ASSERT_NO_FATAL_FAILURE(InstallTestSessionKeys(&session_));
|
||||
ASSERT_NO_FATAL_FAILURE(MakeFourKeys());
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
void TearDown() override {
|
||||
session_.close();
|
||||
OEMCryptoSessionTests::TearDown();
|
||||
}
|
||||
@@ -4626,7 +4626,7 @@ const unsigned int kLongKeyId = 2;
|
||||
|
||||
class GenericCryptoKeyIdLengthTest : public GenericCryptoTest {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
GenericCryptoTest::SetUp();
|
||||
const uint32_t kNoNonce = 0;
|
||||
session_.set_num_keys(5);
|
||||
@@ -4702,7 +4702,7 @@ TEST_F(GenericCryptoKeyIdLengthTest, UniformLongKeyId) {
|
||||
|
||||
class UsageTableTest : public GenericCryptoTest {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
GenericCryptoTest::SetUp();
|
||||
new_mac_keys_ = true;
|
||||
}
|
||||
@@ -4758,7 +4758,7 @@ class UsageTableTest : public GenericCryptoTest {
|
||||
class UsageTableTestWithMAC : public UsageTableTest,
|
||||
public WithParamInterface<bool> {
|
||||
public:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
UsageTableTest::SetUp();
|
||||
new_mac_keys_ = GetParam();
|
||||
}
|
||||
|
||||
@@ -23,12 +23,12 @@ namespace wvoec {
|
||||
// These tests are required for LollyPop Android devices.
|
||||
class OEMCryptoAndroidLMPTest : public ::testing::Test {
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
void SetUp() override {
|
||||
OEMCrypto_SetSandbox(kTestSandbox, sizeof(kTestSandbox));
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_Initialize());
|
||||
}
|
||||
|
||||
virtual void TearDown() { OEMCrypto_Terminate(); }
|
||||
void TearDown() override { OEMCrypto_Terminate(); }
|
||||
};
|
||||
|
||||
// Android devices must have a keybox, or use provisioning 3.0.
|
||||
|
||||
Reference in New Issue
Block a user