Commit 4fc4f01
Fixing false positives for MISRA C++ 2023 Rule 6.5.1 on googletest ma… (danmar#8086)
When running cppcheck premium with MISRA C++2023 Rule 6.5.1 enabled on
unittests using googletests with `--library=googletest`, cppcheck is
flagging each `TEST(test_suite_name, test_name)` with violation of Rule
6.5.1.
The current definition of `TEST(A,B)` in `googletest.cfg` defines the
function without special care, which violates the MISRA rule.
Following the original MACRO definition from googletest, the PR
introduces encapsulation with a class.
Co-authored-by: Florian Mueller <development@muelleflorian.eu>1 parent 0cb895d commit 4fc4f01
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
0 commit comments