refs #14498 - do not create global static instances of the checks#8555
refs #14498 - do not create global static instances of the checks#8555firewave wants to merge 3 commits into
Conversation
|
Since we switched to non- As a follow-up we can stop relying on the global check instances in the tests and use local ones instead. As a final step this will (hopefully) finally allow us to land #5323. |
| Check& operator=(const Check &) = delete; | ||
|
|
||
| /** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */ | ||
| static std::list<Check *> &instances(); |
There was a problem hiding this comment.
As another positive side effect this no longer needs to return a mutable reference.
|
|
||
| private: | ||
| void run() override { | ||
| TEST_CASE(instancesSorted); |
There was a problem hiding this comment.
As we now have a fixed order of the checks there no longer is any reason to sort them.
e29a0c1 to
34f7be7
Compare
ab5d808 to
d6d29c5
Compare
…d instead just not implementing them
| { | ||
| private: | ||
| /* *INDENT-OFF* */ | ||
| #define UPI(c) std::unique_ptr<c> m##c{new c} |
| { | ||
| private: | ||
| /* *INDENT-OFF* */ | ||
| #define UPI(c) std::unique_ptr<c> m##c{new c} |
| { | ||
| private: | ||
| /* *INDENT-OFF* */ | ||
| #define UPI(c) std::unique_ptr<c> m##c{new c} |
| { | ||
| private: | ||
| /* *INDENT-OFF* */ | ||
| #define UPI(c) std::unique_ptr<c> m##c{new c} |
|
Maybe someone can come up with an improved macro that would also build the list so we only need to specify the check name once. Could also be done in a follow-up since I have other changes already lined up. |
No description provided.