@@ -2083,7 +2083,10 @@ class TestUnusedVar : public TestFixture {
20832083 " {\n "
20842084 " int i(0);\n "
20852085 " }" );
2086- ASSERT_EQUALS (" [test.cpp:3]: (style) Variable 'i' is assigned a value that is never used.\n " , errout_str ());
2086+ ASSERT_EQUALS (
2087+ " [test.cpp:3]: (style) Variable 'i' is assigned a value that is never used.\n "
2088+ " [test.cpp:3]: (style) Variable 'i' is assigned a value that is never used.\n " , // duplicate
2089+ errout_str ());
20872090
20882091 // if a is undefined then Cppcheck can't determine if "int i(a)" is a
20892092 // * variable declaration
@@ -2099,7 +2102,10 @@ class TestUnusedVar : public TestFixture {
20992102 " int j = 0;\n "
21002103 " int i(j);\n "
21012104 " }" );
2102- ASSERT_EQUALS (" [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n " , errout_str ());
2105+ ASSERT_EQUALS (
2106+ " [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n "
2107+ " [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n " , // duplicate
2108+ errout_str ());
21032109
21042110 functionVariableUsage (" void foo()\n "
21052111 " {\n "
@@ -2138,7 +2144,10 @@ class TestUnusedVar : public TestFixture {
21382144 " int * j = Data;\n "
21392145 " int * i(j);\n "
21402146 " }" );
2141- ASSERT_EQUALS (" [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n " , errout_str ());
2147+ ASSERT_EQUALS (
2148+ " [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n "
2149+ " [test.cpp:4]: (style) Variable 'i' is assigned a value that is never used.\n " , // duplicate
2150+ errout_str ());
21422151
21432152 functionVariableUsage (" void foo()\n "
21442153 " {\n "
@@ -6841,7 +6850,10 @@ class TestUnusedVar : public TestFixture {
68416850 functionVariableUsage (" void f(int* p) {\n "
68426851 " int* q{ p };\n "
68436852 " }\n " );
6844- ASSERT_EQUALS (" [test.cpp:2]: (style) Variable 'q' is assigned a value that is never used.\n " , errout_str ());
6853+ ASSERT_EQUALS (
6854+ " [test.cpp:2]: (style) Variable 'q' is assigned a value that is never used.\n "
6855+ " [test.cpp:2]: (style) Variable 'q' is assigned a value that is never used.\n " , // duplicate
6856+ errout_str ());
68456857 }
68466858
68476859 void localvarRangeBasedFor () {
0 commit comments