Skip to content

Commit 9aa2c85

Browse files
committed
Fix #13944 tests
1 parent 46185d6 commit 9aa2c85

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4749,6 +4749,31 @@ class TestOther : public TestFixture {
47494749
" return [](int* p) { return *p; }(&i);\n"
47504750
"}\n");
47514751
ASSERT_EQUALS("[test.cpp:3:20]: (style) Parameter 'p' can be declared as pointer to const [constParameterPointer]\n", errout_str());
4752+
4753+
check("class A {\n"
4754+
"public:\n"
4755+
" void func01(QPoint* pt1) {\n"
4756+
" if (nullptr == pt1) {}\n"
4757+
" }\n"
4758+
"};\n");
4759+
ASSERT_EQUALS("[test.cpp:3:25]: (style) Parameter 'pt1' can be declared as pointer to const [constParameterPointer]\n",
4760+
errout_str());
4761+
4762+
check("class A : public QObject {\n"
4763+
"public:\n"
4764+
" void func01(QPoint* pt2) {\n"
4765+
" if (nullptr == pt2) {}\n"
4766+
" }\n"
4767+
"};\n");
4768+
ASSERT_EQUALS("[test.cpp:3:25]: (style) Either there is missing override/final keyword, or the Parameter 'pt2' can be pointer to const [constParameterPointer]\n",
4769+
errout_str());
4770+
check("class A : public QObject {\n"
4771+
"public:\n"
4772+
" void func01(QPoint* pt3) override {\n"
4773+
" if (nullptr == pt3) {}\n"
4774+
" }\n"
4775+
"};\n");
4776+
ASSERT_EQUALS("", errout_str());
47524777
}
47534778

47544779
void constArray() {

0 commit comments

Comments
 (0)