From f73593a4034d9eec0ec4466b8e173d4a4daece1f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 19:41:53 +0000 Subject: Drop usage of macro APT_OVERRIDE for simple override We were rather inconsistent in using it and as our public headers contain deduction guides (a c++17 feature) it seems silly to try to hide a c++11 feature in a macro, so lets stop this charade and drop the macro and while we are changing all these lines lets apply [[nodiscard]] (another c++17 feature) and other suggestions from clang-tidy and formatting for a little more consistency. --- test/libapt/acqprogress_test.cc | 4 ++-- test/libapt/extracttar_test.cc | 6 +++--- test/libapt/indexcopytosourcelist_test.cc | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'test/libapt') diff --git a/test/libapt/acqprogress_test.cc b/test/libapt/acqprogress_test.cc index 17a04161e..16b17c3a4 100644 --- a/test/libapt/acqprogress_test.cc +++ b/test/libapt/acqprogress_test.cc @@ -13,8 +13,8 @@ class TestItem: public pkgAcquire::Item public: explicit TestItem(pkgAcquire * const Acq) : pkgAcquire::Item(Acq) {} - virtual std::string DescURI() const APT_OVERRIDE { return ""; } - virtual HashStringList GetExpectedHashes() const APT_OVERRIDE { return HashStringList(); } + [[nodiscard]] std::string DescURI() const override { return ""; } + [[nodiscard]] HashStringList GetExpectedHashes() const override { return {}; } }; diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc index b01846c10..bf3a3e3bd 100644 --- a/test/libapt/extracttar_test.cc +++ b/test/libapt/extracttar_test.cc @@ -14,9 +14,9 @@ class Stream : public pkgDirStream public: int count; Stream () { count = 0; } - bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE { (void)Itm; (void)Fd; count++; return true; } - bool Fail(Item &Itm,int Fd) APT_OVERRIDE { (void)Itm; (void)Fd; return true; } - bool FinishedFile(Item &Itm,int Fd) APT_OVERRIDE { (void)Itm; (void)Fd; return true; } + bool DoItem(Item &Itm,int &Fd) override { (void)Itm; (void)Fd; count++; return true; } + bool Fail(Item &Itm,int Fd) override { (void)Itm; (void)Fd; return true; } + bool FinishedFile(Item &Itm,int Fd) override { (void)Itm; (void)Fd; return true; } ~Stream() {} }; diff --git a/test/libapt/indexcopytosourcelist_test.cc b/test/libapt/indexcopytosourcelist_test.cc index a1fed06fa..f112ae937 100644 --- a/test/libapt/indexcopytosourcelist_test.cc +++ b/test/libapt/indexcopytosourcelist_test.cc @@ -15,10 +15,10 @@ class NoCopy : private IndexCopy { IndexCopy::ConvertToSourceList(CD, Path); return Path; } - bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) APT_OVERRIDE { return false; } - bool RewriteEntry(FileFd & /*Target*/, std::string const &/*File*/) APT_OVERRIDE { return false; } - const char *GetFileName() APT_OVERRIDE { return NULL; } - const char *Type() APT_OVERRIDE { return NULL; } + bool GetFile(std::string &/*Filename*/, unsigned long long &/*Size*/) override { return false; } + bool RewriteEntry(FileFd & /*Target*/, std::string const &/*File*/) override { return false; } + const char *GetFileName() override { return nullptr; } + const char *Type() override { return nullptr; } }; -- cgit v1.2.3-70-g09d2