fixed clang-tidy errors
fixed clang compilation error and few clang-tidy issues
Tested:
- Code compiles, all unit tests are passing
- Number of reported clang-tidy issues decreased
Change-Id: Ie3f88db6e2dffb26ec6c56dbdc1ce5bad288dccd
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/tests/src/dbus_environment.hpp b/tests/src/dbus_environment.hpp
index 86d7007..eabb53a 100644
--- a/tests/src/dbus_environment.hpp
+++ b/tests/src/dbus_environment.hpp
@@ -119,14 +119,14 @@
setProperty(const std::string& path, const std::string& interfaceName,
const std::string& property, const T& newValue)
{
- auto setPromise = std::promise<boost::system::error_code>();
- auto future = setPromise.get_future();
+ auto promise = std::promise<boost::system::error_code>();
+ auto future = promise.get_future();
sdbusplus::asio::setProperty(
*DbusEnvironment::getBus(), DbusEnvironment::serviceName(), path,
interfaceName, property, std::move(newValue),
- [setPromise =
- std::move(setPromise)](boost::system::error_code ec) mutable {
- setPromise.set_value(ec);
+ [promise =
+ std::move(promise)](boost::system::error_code ec) mutable {
+ promise.set_value(ec);
});
return DbusEnvironment::waitForFuture(std::move(future));
}
diff --git a/tests/src/mocks/report_mock.hpp b/tests/src/mocks/report_mock.hpp
index 6a6e259..758290c 100644
--- a/tests/src/mocks/report_mock.hpp
+++ b/tests/src/mocks/report_mock.hpp
@@ -7,7 +7,7 @@
class ReportMock : public interfaces::Report
{
public:
- ReportMock(const std::string& id)
+ explicit ReportMock(const std::string& id)
{
using namespace testing;
diff --git a/tests/src/mocks/trigger_mock.hpp b/tests/src/mocks/trigger_mock.hpp
index be40a65..cd0e5f4 100644
--- a/tests/src/mocks/trigger_mock.hpp
+++ b/tests/src/mocks/trigger_mock.hpp
@@ -7,7 +7,7 @@
class TriggerMock : public interfaces::Trigger
{
public:
- TriggerMock(std::string id)
+ explicit TriggerMock(std::string id)
{
using namespace testing;
diff --git a/tests/src/test_sensor.cpp b/tests/src/test_sensor.cpp
index 0eae668..c0a9dc3 100644
--- a/tests/src/test_sensor.cpp
+++ b/tests/src/test_sensor.cpp
@@ -110,9 +110,6 @@
ASSERT_TRUE(DbusEnvironment::waitForFuture("async_read"));
}
-
- std::shared_ptr<SensorListenerMock> listenerMock2 =
- std::make_shared<StrictMock<SensorListenerMock>>();
};
TEST_F(TestSensorNotification, notifiesListenerWithValueWhenChangeOccurs)