clang-tidy: Enable readability-convert-member-functions-to-static
This check finds non-static member functions that can be made
static because the functions don’t use this.
This check also triggers readability-static-accessed-through
-instance check as we are trying to access a static member
function through an instance.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I6c06c61e8f199247e74aca3443741683e3853274
diff --git a/test/test_item_updater.cpp b/test/test_item_updater.cpp
index 096e15f..7fd1e7a 100644
--- a/test/test_item_updater.cpp
+++ b/test/test_item_updater.cpp
@@ -46,7 +46,7 @@
return itemUpdater->activations;
}
- std::string getObjPath(const std::string& versionId)
+ static std::string getObjPath(const std::string& versionId)
{
return std::string(dBusPath) + "/" + versionId;
}
diff --git a/test/test_version.cpp b/test/test_version.cpp
index d447e10..ee41bf1 100644
--- a/test/test_version.cpp
+++ b/test/test_version.cpp
@@ -45,7 +45,7 @@
fs::remove_all(tmpDir);
}
- void writeFile(const fs::path& file, const char* data)
+ static void writeFile(const fs::path& file, const char* data)
{
std::ofstream f{file};
f << data;