Fix function erroneously declared as static #37
Conversation
How about make it a member function of |
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
=======================================
Coverage 42.04% 42.04%
=======================================
Files 26 27 +1
Lines 880 880
Branches 506 506
=======================================
Hits 370 370
Misses 50 50
Partials 460 460
Continue to review full report at Codecov.
|
It's generally better to avoid fixing bugs and refactoring in the same PR. I don't have a strong opinion one way or another (except that a header called edit: that being said I just dropped the spurious edit2: the tests relies on a char-for-char diff of the string so I can't get rid of |
739dcc4
to
cedc008
Compare
Functions declared in headers should never be static. In the previous implementation, statisticsDataToString was duplicated in each compilation unit as the function was both defined in the header and declared as static. Signed-off-by: Thomas Moulard <tmoulard@amazon.com>
cedc008
to
f79f702
Compare
@@ -35,6 +35,7 @@ find_package(rcutils REQUIRED) | |||
|
|||
add_library(system_metrics_collector SHARED | |||
src/moving_average_statistics/moving_average.cpp | |||
src/moving_average_statistics/types.cpp | |||
src/moving_average_statistics/types.hpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .hpp
file should not be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some people prefer that style because then you get the headers in the auto-generated IDE solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's the intention here, otherwise this is a consistency issue, because why would this be the only header file under add_library()
?
I don't understand why the partial hit is still there - this is why the coverage tests is failing. Merging as I don't know how long it will take to understand the root cause here. |
Functions declared in headers should never be static.
In the previous implementation, statisticsDataToString was duplicated
in each compilation unit as the function was both defined in the header
and declared as static.