From ac6cdc8dd5f42820014b5d0b09b5e52593fb0a20 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 10 Mar 2017 16:18:56 +0300 Subject: Add check for new CLASS(). Here brackets should be removed. --- tests/testreport.txt | 6 ++++-- tests/testsrc/bad/brackets.cpp | 2 ++ tests/testsrc/bad/brackets.h | 7 +++++++ tests/testsrc/good/brackets2.cpp | 2 ++ tests/testsrc/good/constructor1.cpp | 2 ++ 5 files changed, 17 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/testreport.txt b/tests/testreport.txt index e56ac61..da80304 100644 --- a/tests/testreport.txt +++ b/tests/testreport.txt @@ -4,9 +4,10 @@ [testsrc/bad/brackets.cpp:45]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.cpp:56]: V015: Brackets formatting error. Wrong first bracket position [testsrc/bad/brackets.cpp:69]: V015: Brackets formatting error. Wrong last bracket position -[testsrc/bad/brackets.cpp:76]: V015: Brackets formatting error. Wrong last bracket position -[testsrc/bad/brackets.cpp:77]: V015: Brackets formatting error. Wrong last bracket position +[testsrc/bad/brackets.cpp:72]: V017: Remove () after new CLASS(). [testsrc/bad/brackets.cpp:78]: V015: Brackets formatting error. Wrong last bracket position +[testsrc/bad/brackets.cpp:79]: V015: Brackets formatting error. Wrong last bracket position +[testsrc/bad/brackets.cpp:80]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.h:21]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.h:32]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.h:43]: V015: Brackets formatting error. Wrong last bracket position @@ -15,6 +16,7 @@ [testsrc/bad/brackets.h:74]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.h:75]: V015: Brackets formatting error. Wrong last bracket position [testsrc/bad/brackets.h:76]: V015: Brackets formatting error. Wrong last bracket position +[testsrc/bad/brackets.h:83]: V017: Remove () after new CLASS(). [testsrc/bad/constructor1.cpp:25]: V007: Need add final or notfinal into class declaration [testsrc/bad/constructor1.cpp:32]: V007: Need add final or notfinal into class declaration [testsrc/bad/constructor1.cpp:34]: V006: Add space between constructor and ":". diff --git a/tests/testsrc/bad/brackets.cpp b/tests/testsrc/bad/brackets.cpp index 898a258..7fc6552 100644 --- a/tests/testsrc/bad/brackets.cpp +++ b/tests/testsrc/bad/brackets.cpp @@ -69,6 +69,8 @@ void func5() else { } } + type *var = new type(); + type2 *var2 = new type2(123); } void func6() diff --git a/tests/testsrc/bad/brackets.h b/tests/testsrc/bad/brackets.h index bb1ba39..d56d23f 100644 --- a/tests/testsrc/bad/brackets.h +++ b/tests/testsrc/bad/brackets.h @@ -77,3 +77,10 @@ void func6() } } } + +void func7() +{ + type *var = new type(); + type *var2; + type2 *var3 = new type2(123); +} diff --git a/tests/testsrc/good/brackets2.cpp b/tests/testsrc/good/brackets2.cpp index 2199d6f..fe9ed3c 100644 --- a/tests/testsrc/good/brackets2.cpp +++ b/tests/testsrc/good/brackets2.cpp @@ -78,4 +78,6 @@ void func6() // } else { // } // } + type *var = mnew type(); + type2 *var = new type2(123); } diff --git a/tests/testsrc/good/constructor1.cpp b/tests/testsrc/good/constructor1.cpp index d300f06..99f12f7 100644 --- a/tests/testsrc/good/constructor1.cpp +++ b/tests/testsrc/good/constructor1.cpp @@ -38,5 +38,7 @@ struct Test2 final data1(), data2() { + type *var = mnew type(); + type2 *var = new type2(123); } } -- cgit v1.2.3-70-g09d2