diff options
author | 2018-08-24 16:58:47 +0100 | |
---|---|---|
committer | 2018-08-28 11:06:07 +0100 | |
commit | bbc6e7edb5fca4a61ac53dd9bce79cb4f0bb3403 (patch) | |
tree | 0fbce767bc383358cf4cd65aafc74140e1850982 /runtime/runtime_callbacks_test.cc | |
parent | 19379b58bd433da91230e4fe6cd96e7416d16adc (diff) |
Use 'final' and 'override' specifiers directly in ART.
Remove all uses of macros 'FINAL' and 'OVERRIDE' and replace them with
'final' and 'override' specifiers. Remove all definitions of these
macros as well, which were located in these files:
- libartbase/base/macros.h
- test/913-heaps/heaps.cc
- test/ti-agent/ti_macros.h
ART is now using C++14; the 'final' and 'override' specifiers have
been introduced in C++11.
Test: mmma art
Change-Id: I256c7758155a71a2940ef2574925a44076feeebf
Diffstat (limited to 'runtime/runtime_callbacks_test.cc')
-rw-r--r-- | runtime/runtime_callbacks_test.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/runtime/runtime_callbacks_test.cc b/runtime/runtime_callbacks_test.cc index ed0472f414..e1e0e23dac 100644 --- a/runtime/runtime_callbacks_test.cc +++ b/runtime/runtime_callbacks_test.cc @@ -50,7 +50,7 @@ namespace art { class RuntimeCallbacksTest : public CommonRuntimeTest { protected: - void SetUp() OVERRIDE { + void SetUp() override { CommonRuntimeTest::SetUp(); Thread* self = Thread::Current(); @@ -60,7 +60,7 @@ class RuntimeCallbacksTest : public CommonRuntimeTest { AddListener(); } - void TearDown() OVERRIDE { + void TearDown() override { { Thread* self = Thread::Current(); ScopedObjectAccess soa(self); @@ -101,10 +101,10 @@ class ThreadLifecycleCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest } protected: - void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void AddListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->AddThreadLifecycleCallback(&cb_); } - void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void RemoveListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->RemoveThreadLifecycleCallback(&cb_); } @@ -117,7 +117,7 @@ class ThreadLifecycleCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest }; struct Callback : public ThreadLifecycleCallback { - void ThreadStart(Thread* self) OVERRIDE { + void ThreadStart(Thread* self) override { if (state == CallbackState::kBase) { state = CallbackState::kStarted; stored_self = self; @@ -126,7 +126,7 @@ class ThreadLifecycleCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest } } - void ThreadDeath(Thread* self) OVERRIDE { + void ThreadDeath(Thread* self) override { if (state == CallbackState::kStarted && self == stored_self) { state = CallbackState::kDied; } else { @@ -219,10 +219,10 @@ TEST_F(ThreadLifecycleCallbackRuntimeCallbacksTest, ThreadLifecycleCallbackAttac class ClassLoadCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { protected: - void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void AddListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->AddClassLoadCallback(&cb_); } - void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void RemoveListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->RemoveClassLoadCallback(&cb_); } @@ -259,7 +259,7 @@ class ClassLoadCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { const DexFile::ClassDef& initial_class_def ATTRIBUTE_UNUSED, /*out*/DexFile const** final_dex_file ATTRIBUTE_UNUSED, /*out*/DexFile::ClassDef const** final_class_def ATTRIBUTE_UNUSED) - OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + override REQUIRES_SHARED(Locks::mutator_lock_) { const std::string& location = initial_dex_file.GetLocation(); std::string event = std::string("PreDefine:") + descriptor + " <" + @@ -267,14 +267,14 @@ class ClassLoadCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { data.push_back(event); } - void ClassLoad(Handle<mirror::Class> klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + void ClassLoad(Handle<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string tmp; std::string event = std::string("Load:") + klass->GetDescriptor(&tmp); data.push_back(event); } void ClassPrepare(Handle<mirror::Class> temp_klass, - Handle<mirror::Class> klass) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) { + Handle<mirror::Class> klass) override REQUIRES_SHARED(Locks::mutator_lock_) { std::string tmp, tmp2; std::string event = std::string("Prepare:") + klass->GetDescriptor(&tmp) + "[" + temp_klass->GetDescriptor(&tmp2) + "]"; @@ -319,15 +319,15 @@ TEST_F(ClassLoadCallbackRuntimeCallbacksTest, ClassLoadCallback) { class RuntimeSigQuitCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { protected: - void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void AddListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->AddRuntimeSigQuitCallback(&cb_); } - void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void RemoveListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->RemoveRuntimeSigQuitCallback(&cb_); } struct Callback : public RuntimeSigQuitCallback { - void SigQuit() OVERRIDE { + void SigQuit() override { ++sigquit_count; } @@ -362,20 +362,20 @@ TEST_F(RuntimeSigQuitCallbackRuntimeCallbacksTest, SigQuit) { class RuntimePhaseCallbackRuntimeCallbacksTest : public RuntimeCallbacksTest { protected: - void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void AddListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->AddRuntimePhaseCallback(&cb_); } - void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void RemoveListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->RemoveRuntimePhaseCallback(&cb_); } - void TearDown() OVERRIDE { + void TearDown() override { // Bypass RuntimeCallbacksTest::TearDown, as the runtime is already gone. CommonRuntimeTest::TearDown(); } struct Callback : public RuntimePhaseCallback { - void NextRuntimePhase(RuntimePhaseCallback::RuntimePhase p) OVERRIDE { + void NextRuntimePhase(RuntimePhaseCallback::RuntimePhase p) override { if (p == RuntimePhaseCallback::RuntimePhase::kInitialAgents) { if (start_seen > 0 || init_seen > 0 || death_seen > 0) { LOG(FATAL) << "Unexpected order"; @@ -434,10 +434,10 @@ TEST_F(RuntimePhaseCallbackRuntimeCallbacksTest, Phases) { class MonitorWaitCallbacksTest : public RuntimeCallbacksTest { protected: - void AddListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void AddListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->AddMonitorCallback(&cb_); } - void RemoveListener() OVERRIDE REQUIRES(Locks::mutator_lock_) { + void RemoveListener() override REQUIRES(Locks::mutator_lock_) { Runtime::Current()->GetRuntimeCallbacks()->RemoveMonitorCallback(&cb_); } |