diff options
author | Pavel Labath <pavel@labath.sk> | 2019-01-02 10:37:38 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-01-02 10:37:38 +0000 |
commit | 512e04bc9de0d3f7554443575d966b0728832c4a (patch) | |
tree | b577b2e44b64d3b10c68d20b4897a0a8ef464219 | |
parent | ab1d92a9e050afee71e39bc6c91836e0864b853d (diff) |
NativeProcessProtocolTest: fix -Winconsistent-missing-override warning
The warning comes from the fact that the MOCK_METHOD macros don't use the
override keyword internally. This makes us not use it in the manually overriden
methods either, to be consistent.
-rw-r--r-- | lldb/unittests/Host/NativeProcessProtocolTest.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/unittests/Host/NativeProcessProtocolTest.cpp b/lldb/unittests/Host/NativeProcessProtocolTest.cpp index 298c2909b61..8a9271af771 100644 --- a/lldb/unittests/Host/NativeProcessProtocolTest.cpp +++ b/lldb/unittests/Host/NativeProcessProtocolTest.cpp @@ -24,6 +24,9 @@ public: MOCK_METHOD1(DidExec, void(NativeProcessProtocol *Process)); }; +// NB: This class doesn't use the override keyword to avoid +// -Winconsistent-missing-override warnings from the compiler. The +// inconsistency comes from the overriding definitions in the MOCK_*** macros. class MockProcess : public NativeProcessProtocol { public: MockProcess(NativeDelegate &Delegate, const ArchSpec &Arch, @@ -47,9 +50,9 @@ public: MOCK_METHOD2(GetFileLoadAddress, Status(const llvm::StringRef &FileName, addr_t &Addr)); - const ArchSpec &GetArchitecture() const override { return Arch; } + const ArchSpec &GetArchitecture() const /*override*/ { return Arch; } Status SetBreakpoint(lldb::addr_t Addr, uint32_t Size, - bool Hardware) override { + bool Hardware) /*override*/ { if (Hardware) return SetHardwareBreakpoint(Addr, Size); else @@ -59,9 +62,9 @@ public: // Redirect base class Read/Write Memory methods to functions whose signatures // are more mock-friendly. Status ReadMemory(addr_t Addr, void *Buf, size_t Size, - size_t &BytesRead) override; + size_t &BytesRead) /*override*/; Status WriteMemory(addr_t Addr, const void *Buf, size_t Size, - size_t &BytesWritten) override; + size_t &BytesWritten) /*override*/; MOCK_METHOD2(ReadMemory, llvm::Expected<std::vector<uint8_t>>(addr_t Addr, size_t Size)); |