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/testclass.cpp
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4033,7 +4033,7 @@ class TestClass : public TestFixture {
4033
4033
"void Fred::foo(std::string & a) { a = s; }\n"
4034
4034
"void Fred::foo(const std::string & a) { s = a; }\n");
4035
4035
ASSERT_EQUALS("[test.cpp:3:10] -> [test.cpp:7:12]: (style) The member function 'Fred::foo' can be static. [functionStatic]\n"
4036
-
"[test.cpp:4:10] -> [test.cpp:7:32]: (style, inconclusive) Technically the member function 'Fred::foo' can be const. [functionConst]\n", errout_str());
4036
+
"[test.cpp:4:10] -> [test.cpp:8:12]: (style, inconclusive) Technically the member function 'Fred::foo' can be const. [functionConst]\n", errout_str());
4037
4037
4038
4038
// check functions with different or missing parameter names
4039
4039
checkConst("class Fred {\n"
@@ -9348,19 +9348,19 @@ class TestClass : public TestFixture {
9348
9348
}
9349
9349
9350
9350
voidctuOneDefinitionRule() {
9351
-
ctu({"class C { C() { std::cout << 0; } };", "class C { C() { std::cout << 1; } };"});
9351
+
ctu({"class C { C() { std::cout << 0; } };\n", "class C { C() { std::cout << 1; } };\n"});
9352
9352
ASSERT_EQUALS("[1.cpp:1:1] -> [0.cpp:1:1]: (error) The one definition rule is violated, different classes/structs have the same name 'C' [ctuOneDefinitionRuleViolation]\n", errout_str());
ASSERT_EQUALS("[1.cpp:1:1] -> [0.cpp:1:1]: (error) The one definition rule is violated, different classes/structs have the same name 'C' [ctuOneDefinitionRuleViolation]\n", errout_str());
9356
9356
9357
9357
ctu({"class C { C() {} };\n", "class C { C() {} };\n"});
9358
9358
ASSERT_EQUALS("", errout_str());
9359
9359
9360
-
ctu({"class C { C(); }; C::C(){}", "class C { C(); }; C::C(){}"});
9360
+
ctu({"class C { C(); }; C::C(){}\n", "class C { C(); }; C::C(){}\n"});
Copy file name to clipboardExpand all lines: test/testsuppressions.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1402,7 +1402,7 @@ class TestSuppressions : public TestFixture {
1402
1402
CppCheck cppCheck(settings, supprs, *this, nullptr, false, nullptr); // <- do not "use global suppressions". pretend this is a thread that just checks a file.
ASSERT_EQUALS(0, cppCheck.checkBuffer(FileWithDetails("test.c", Standards::Language::C, 0),code, sizeof(code))); // <- no unsuppressed error is seen
1405
+
ASSERT_EQUALS(0, cppCheck.checkBuffer(FileWithDetails("test.c", Standards::Language::C, 0),code, sizeof(code)-1)); // <- no unsuppressed error is seen
1406
1406
ASSERT_EQUALS("[test.c:1:25]: (error) Uninitialized variable: a [uninitvar]\n", errout_str()); // <- report error so ThreadExecutor can suppress it and make sure the global suppression is matched.
1407
1407
}
1408
1408
@@ -1442,7 +1442,7 @@ class TestSuppressions : public TestFixture {
0 commit comments