You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2021/01/04 14:20:36 UTC

[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

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