You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/testother.cpp
+27-3Lines changed: 27 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,7 @@ class TestOther : public TestFixture {
99
99
100
100
TEST_CASE(constVariable);
101
101
TEST_CASE(constParameterCallback);
102
+
TEST_CASE(constPointer);
102
103
103
104
TEST_CASE(switchRedundantAssignmentTest);
104
105
TEST_CASE(switchRedundantOperationTest);
@@ -2631,6 +2632,29 @@ class TestOther : public TestFixture {
2631
2632
ASSERT_EQUALS("[test.cpp:10] -> [test.cpp:13]: (style) Parameter 'signal' can be declared with const. However it seems that 'signalEvent' is a callback function, if 'signal' is declared with const you might also need to cast function pointer(s).\n", errout.str());
2632
2633
}
2633
2634
2635
+
voidconstPointer() {
2636
+
check("void foo(int *p) { return *p; }");
2637
+
ASSERT_EQUALS("[test.cpp:1]: (style) Parameter 'p' can be declared with const\n", errout.str());
2638
+
2639
+
check("void foo(int *p) { x = *p; }");
2640
+
ASSERT_EQUALS("[test.cpp:1]: (style) Parameter 'p' can be declared with const\n", errout.str());
0 commit comments