From 1dd97e6efcb42b953c593c37eb7e3445f7969704 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Wed, 31 Jul 2024 08:23:11 +0200 Subject: [PATCH] change compare --- src/tests/ras/utils/inject_manager/inject_manager.cc | 9 ++++----- src/tests/ras/utils/inject_manager/inject_manager.h | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/tests/ras/utils/inject_manager/inject_manager.cc b/src/tests/ras/utils/inject_manager/inject_manager.cc index 69f0f63..9fa44ec 100644 --- a/src/tests/ras/utils/inject_manager/inject_manager.cc +++ b/src/tests/ras/utils/inject_manager/inject_manager.cc @@ -110,8 +110,7 @@ const std::vector InjectManager::GetDimmsToInject( } bool InjectManager::CheckUSCDiff( - const std::vector &dimm_namespaces, - std::function compare) const { + const std::vector &dimm_namespaces) const { bool ret = true; for (const auto &dn : dimm_namespaces) { for (const auto &d : GetDimmsToInject(dn)) { @@ -123,7 +122,7 @@ bool InjectManager::CheckUSCDiff( ret = false; } - if (!compare(recorded_usc, d.GetShutdownCount())) { + if (recorded_usc == d.GetShutdownCount()) { std::cerr << "NVDIMM: " << d.GetUid() << " (test dir: " << dn.GetTestDir() << "). Current USC: " << d.GetShutdownCount() @@ -159,7 +158,7 @@ bool InjectManager::IsLastShutdownUnsafe( return cur > rec; }; - if (!CheckUSCDiff(dimm_namespaces, compare)) { + if (!CheckUSCDiff(dimm_namespaces)) { std::cerr << "Unexpected safe shutdown of NVDIMM" << std::endl; return false; } @@ -172,7 +171,7 @@ bool InjectManager::IsLastShutdownSafe( return cur == rec; }; - if (!CheckUSCDiff(dimm_namespaces, compare)) { + if (!CheckUSCDiff(dimm_namespaces)) { std::cerr << "Unexpected unsafe shutdown of NVDIMM" << std::endl; return false; } diff --git a/src/tests/ras/utils/inject_manager/inject_manager.h b/src/tests/ras/utils/inject_manager/inject_manager.h index 820f5ae..94531fe 100644 --- a/src/tests/ras/utils/inject_manager/inject_manager.h +++ b/src/tests/ras/utils/inject_manager/inject_manager.h @@ -58,8 +58,7 @@ class InjectManager { private: std::string test_dir_; InjectPolicy policy_; - bool CheckUSCDiff(const std::vector &dimm_namespaces, - std::function compare) const; + bool CheckUSCDiff(const std::vector &dimm_namespaces) const; int ReadRecordedUSC(const std::string &usc_file_path) const;