diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index 37c122e88..c10c82a16 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -3304,13 +3304,6 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:6]: (error) Buffer is accessed out of bounds: c\n", errout.str()); - check("void f()\n" - "{\n" - " char c[6];\n" - " strncpy(c,\"hello!\",sizeof(c));\n" - "}\n"); - ASSERT_EQUALS("[test.cpp:4]: (warning, inconclusive) The buffer 'c' is not null-terminated after the call to strncpy().\n", errout.str()); - check("void f()\n" "{\n" " char c[6];\n" diff --git a/test/testclass.cpp b/test/testclass.cpp index c0927ff69..1b880a395 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -1462,12 +1462,6 @@ private: // Only report error if base class pointer is deleted that // points at derived class - checkVirtualDestructor("class Base { public: ~Base(); };\n" - "class Derived : public Base { public: ~Derived() { (void)11; } };" - "Base *base = new Derived;\n" - "delete base;"); - ASSERT_EQUALS("[test.cpp:1]: (error) Class 'Base' which is inherited by class 'Derived' does not have a virtual destructor.\n", errout.str()); - checkVirtualDestructor("class Base { public: ~Base(); };\n" "class Derived : public Base { public: ~Derived() { (void)11; } };"); ASSERT_EQUALS("", errout.str()); diff --git a/test/testother.cpp b/test/testother.cpp index 41a217139..b106e2771 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -3254,7 +3254,7 @@ private: ASSERT_EQUALS("[test.cpp:2]: (warning) Comparison of a boolean value using relational (<, >, <= or >=) operator.\n", errout.str()); check("void f(bool x ) {\n" - " if ( false >= x )\n" + " if ( false <= x )\n" " a++;\n" "}\n" ); @@ -3656,21 +3656,11 @@ private: "}"); ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'a' is used in bitwise operation. Did you mean || ?\n", errout.str()); - check("void f(bool a, bool b) {\n" - " if(a & b) {}\n" - "}"); - ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'a' is used in bitwise operation. Did you mean && ?\n", errout.str()); - check("void f(bool a, bool b) {\n" " if(a & !b) {}\n" "}"); ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'a' is used in bitwise operation. Did you mean && ?\n", errout.str()); - check("void f(bool a, bool b) {\n" - " if(a | b) {}\n" - "}"); - ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'a' is used in bitwise operation. Did you mean || ?\n", errout.str()); - check("void f(bool a, bool b) {\n" " if(a | !b) {}\n" "}"); @@ -3710,11 +3700,6 @@ private: "}"); ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'b' is used in bitwise operation. Did you mean && ?\n", errout.str()); - check("void f(bool a, bool b) {\n" - " if(a & b) {}\n" - "}"); - ASSERT_EQUALS("[test.cpp:2]: (style, inconclusive) Boolean variable 'a' is used in bitwise operation. Did you mean && ?\n", errout.str()); - check("void f(int a, int b) {\n" " if(a & b) {}\n" "}"); diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 9e6641033..9c9725e7f 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -5082,7 +5082,7 @@ private: void simplifyTypedef66() { // ticket #2341 const char code[] = "typedef long* GEN;\n" "extern GEN (*foo)(long);"; - const std::string actual(tok(code)); + tok(code); ASSERT_EQUALS("", errout.str()); }