celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo commented on a change in pull request #311: Added member initialization for framework test to fix building with -Weffc++ and/or -Werror
Date Mon, 04 Jan 2021 14:20:36 GMT

Oipo commented on a change in pull request #311:
URL: https://github.com/apache/celix/pull/311#discussion_r551343583



##########
File path: libs/framework/gtest/src/DependencyManagerTestSuite.cc
##########
@@ -114,6 +114,10 @@ TEST_F(DependencyManagerTestSuite, StartDmWillBuildCmp) {
 }
 
 struct TestService {
+public:
+    TestService() : handle(nullptr) {};
+    TestService(void *_handle) : handle(_handle) {};

Review comment:
       It's a bit of a nitpick, but these constructors are not necessary. It's a [best practice](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-zero)
to not define constructors/destructors if possible. Modify line 121 to `void *handle{nullptr};`
instead.
   
   Consequently, modify all initializations of TestService to `TestService svc{};` (e.g. line
162).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message