fix spelling of initialized in checkclass messages
This commit is contained in:
parent
29c73e0571
commit
6abf29bd22
|
@ -551,7 +551,7 @@ void CheckClass::noConstructorError(const Token *tok, const std::string &classna
|
|||
|
||||
void CheckClass::uninitVarError(const Token *tok, const std::string &classname, const std::string &varname)
|
||||
{
|
||||
reportError(tok, Severity::warning, "uninitVar", "Member variable '" + classname + "::" + varname + "' is not initialised in the constructor.");
|
||||
reportError(tok, Severity::warning, "uninitVar", "Member variable '" + classname + "::" + varname + "' is not initialized in the constructor.");
|
||||
}
|
||||
|
||||
void CheckClass::operatorEqVarError(const Token *tok, const std::string &classname, const std::string &varname)
|
||||
|
|
|
@ -1683,7 +1683,7 @@ private:
|
|||
" ECODES _code;\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Fred::_code' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Fred::_code' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
|
||||
checkUninitVar("class A{};\n"
|
||||
|
@ -1695,7 +1695,7 @@ private:
|
|||
"private:\n"
|
||||
" float f;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'B::f' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'B::f' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
checkUninitVar("class C\n"
|
||||
"{\n"
|
||||
|
@ -1749,7 +1749,7 @@ private:
|
|||
" };\n"
|
||||
" Bar bars[2];\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Foo::bars' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Foo::bars' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar4()
|
||||
|
@ -1844,7 +1844,7 @@ private:
|
|||
"{\n"
|
||||
" SetMinSize( wxSize( 48,48 ) );\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Prefs::xasd' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Prefs::xasd' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar10() // ticket #1993
|
||||
|
@ -1857,7 +1857,7 @@ private:
|
|||
" int var2;\n"
|
||||
"};\n"
|
||||
"A::A() : var1(0) { }\n");
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'A::var2' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'A::var2' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar11()
|
||||
|
@ -1869,7 +1869,7 @@ private:
|
|||
" int var;\n"
|
||||
"};\n"
|
||||
"A::A(int a) { }\n");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'A::var' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'A::var' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar12() // ticket #2078
|
||||
|
@ -1886,8 +1886,8 @@ private:
|
|||
" {}\n"
|
||||
" int x, y;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Point::x' is not initialised in the constructor.\n"
|
||||
"[test.cpp:4]: (warning) Member variable 'Point::y' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Point::x' is not initialized in the constructor.\n"
|
||||
"[test.cpp:4]: (warning) Member variable 'Point::y' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar13() // ticket #1195
|
||||
|
@ -1899,7 +1899,7 @@ private:
|
|||
" A()\n"
|
||||
" {}\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'A::ints' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'A::ints' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar14() // ticket #2149
|
||||
|
@ -1915,7 +1915,7 @@ private:
|
|||
"Foo::Foo()\n"
|
||||
"{\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'Foo::mMember' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// single namespace
|
||||
checkUninitVar("namespace Output\n"
|
||||
|
@ -1931,7 +1931,7 @@ private:
|
|||
" {\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Foo::mMember' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// constructor outside namespace
|
||||
checkUninitVar("namespace Output\n"
|
||||
|
@ -1963,7 +1963,7 @@ private:
|
|||
"Output::Foo::Foo()\n"
|
||||
"{\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// constructor in separate namespace
|
||||
checkUninitVar("namespace Output\n"
|
||||
|
@ -1982,7 +1982,7 @@ private:
|
|||
" {\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:13]: (warning) Member variable 'Foo::mMember' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:13]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// constructor in different separate namespace
|
||||
checkUninitVar("namespace Output\n"
|
||||
|
@ -2042,7 +2042,7 @@ private:
|
|||
" }\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:15]: (warning) Member variable 'Foo::mMember' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:15]: (warning) Member variable 'Foo::mMember' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// constructor in nested different separate namespace
|
||||
checkUninitVar("namespace A\n"
|
||||
|
@ -2135,7 +2135,7 @@ private:
|
|||
" {\n"
|
||||
" }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Bar::foo' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Bar::foo' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar17()
|
||||
|
@ -2167,7 +2167,7 @@ private:
|
|||
" {\n"
|
||||
" }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'Bar::foo' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'Bar::foo' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar18() // ticket #2465
|
||||
|
@ -2198,7 +2198,7 @@ private:
|
|||
"private:\n"
|
||||
" Altren value;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'A::value' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'A::value' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVarArray1()
|
||||
|
@ -2211,7 +2211,7 @@ private:
|
|||
"private:\n"
|
||||
" char name[255];\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'John::name' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'John::name' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
checkUninitVar("class John\n"
|
||||
"{\n"
|
||||
|
@ -2258,7 +2258,7 @@ private:
|
|||
" John() { }\n"
|
||||
" A *a[5];\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'John::a' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'John::a' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVarArray2()
|
||||
|
@ -2377,7 +2377,7 @@ private:
|
|||
" A() {\n"
|
||||
" }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'A::b' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'A::b' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
checkUninitVar("class A\n"
|
||||
"{\n"
|
||||
|
@ -2410,7 +2410,7 @@ private:
|
|||
" Fred()\n"
|
||||
" { }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Fred::p' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Fred::p' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
checkUninitVar("struct POINT\n"
|
||||
"{\n"
|
||||
|
@ -2477,7 +2477,7 @@ private:
|
|||
"private:\n"
|
||||
" int i;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// Unknown non-member function
|
||||
checkUninitVar("class Fred\n"
|
||||
|
@ -2487,7 +2487,7 @@ private:
|
|||
"private:\n"
|
||||
" int i;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// Unknown non-member function
|
||||
checkUninitVar("class ABC { };\n"
|
||||
|
@ -2498,7 +2498,7 @@ private:
|
|||
"private:\n"
|
||||
" int i;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
}
|
||||
|
||||
|
@ -2513,7 +2513,7 @@ private:
|
|||
" unsigned int i;\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVarStream()
|
||||
|
@ -2579,7 +2579,7 @@ private:
|
|||
" Foo(int _i) { }\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Foo::foo' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Foo::foo' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -2630,7 +2630,7 @@ private:
|
|||
" Fred() { }\n"
|
||||
"};\n"
|
||||
"#endfile\n");
|
||||
ASSERT_EQUALS("[fred.h:6]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[fred.h:6]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitVarHeader3()
|
||||
|
@ -2644,7 +2644,7 @@ private:
|
|||
" Fred() { }\n"
|
||||
"};\n"
|
||||
"#endfile\n");
|
||||
ASSERT_EQUALS("[fred.h:6]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[fred.h:6]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
// Borland C++: No FP for published pointers - they are automatically initialized
|
||||
|
@ -2695,7 +2695,7 @@ private:
|
|||
"\n"
|
||||
" double d;\n"
|
||||
"};\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialised in the constructor.\n", "", errout.str());
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialized in the constructor.\n", "", errout.str());
|
||||
}
|
||||
|
||||
void uninitFunction2()
|
||||
|
@ -2722,7 +2722,7 @@ private:
|
|||
"\n"
|
||||
" double d;\n"
|
||||
"};\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialised in the constructor.\n", "", errout.str());
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialized in the constructor.\n", "", errout.str());
|
||||
}
|
||||
|
||||
void uninitFunction3()
|
||||
|
@ -2749,7 +2749,7 @@ private:
|
|||
"\n"
|
||||
" double d;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void uninitFunction4()
|
||||
|
@ -2776,7 +2776,7 @@ private:
|
|||
"\n"
|
||||
" double d;\n"
|
||||
"};\n");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialised in the constructor.\n", "", errout.str());
|
||||
TODO_ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::d' is not initialized in the constructor.\n", "", errout.str());
|
||||
}
|
||||
|
||||
void uninitSameClassName()
|
||||
|
@ -2828,8 +2828,8 @@ private:
|
|||
"A::B::B()\n"
|
||||
"{\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:18]: (warning) Member variable 'B::j' is not initialised in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'B::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:18]: (warning) Member variable 'B::j' is not initialized in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'B::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
// Ticket #1700
|
||||
checkUninitVar("namespace n1\n"
|
||||
|
@ -2871,7 +2871,7 @@ private:
|
|||
" Foo() { }\n"
|
||||
"};\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:11]: (warning) Member variable 'Foo::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
checkUninitVar("namespace n1\n"
|
||||
"{\n"
|
||||
|
@ -2933,7 +2933,7 @@ private:
|
|||
" void init(int value)\n"
|
||||
" { }\n"
|
||||
"};");
|
||||
TODO_ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'A::i' is not initialised in the constructor.\n", "", errout.str());
|
||||
TODO_ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'A::i' is not initialized in the constructor.\n", "", errout.str());
|
||||
}
|
||||
|
||||
void checkUninitVarJava(const char code[])
|
||||
|
@ -2992,7 +2992,7 @@ private:
|
|||
" return *this;\n"
|
||||
" }\n"
|
||||
"};");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'A::a' is not initialised in the constructor.\n"
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'A::a' is not initialized in the constructor.\n"
|
||||
"[test.cpp:5]: (warning) Member variable 'A::a' is not assigned a value in 'A::operator='\n", errout.str());
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ private:
|
|||
" Fred() { }\n"
|
||||
" int i;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:4]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("struct Fred\n"
|
||||
"{\n"
|
||||
|
@ -163,7 +163,7 @@ private:
|
|||
" Fred() { }\n"
|
||||
" int i;\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:3]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:3]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -197,7 +197,7 @@ private:
|
|||
"};\n"
|
||||
"Fred::Fred()\n"
|
||||
"{ }\n");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("struct Fred\n"
|
||||
"{\n"
|
||||
|
@ -224,7 +224,7 @@ private:
|
|||
"};\n"
|
||||
"Fred::Fred()\n"
|
||||
"{ }\n");
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,7 +243,7 @@ private:
|
|||
"{\n"
|
||||
" i = _i;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:8]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("struct Fred\n"
|
||||
"{\n"
|
||||
|
@ -257,7 +257,7 @@ private:
|
|||
"{\n"
|
||||
" i = _i;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::i' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::i' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void simple5() // ticket #2560
|
||||
|
@ -619,8 +619,8 @@ private:
|
|||
" }\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::a' is not initialised in the constructor.\n"
|
||||
"[test.cpp:16]: (warning) Member variable 'Fred::b' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::a' is not initialized in the constructor.\n"
|
||||
"[test.cpp:16]: (warning) Member variable 'Fred::b' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void initvar_chained_assign()
|
||||
|
@ -753,7 +753,7 @@ private:
|
|||
"};\n"
|
||||
"Fred::Fred()\n"
|
||||
"{ }");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::s' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::s' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("struct Fred\n"
|
||||
"{\n"
|
||||
|
@ -780,7 +780,7 @@ private:
|
|||
"};\n"
|
||||
"Fred::Fred()\n"
|
||||
"{ }");
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'Fred::s' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'Fred::s' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -825,7 +825,7 @@ private:
|
|||
" {\n"
|
||||
" }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'Fred::U' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:9]: (warning) Member variable 'Fred::U' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -852,7 +852,7 @@ private:
|
|||
" Fred() { };\n"
|
||||
" Fred(const Fred &) { };\n"
|
||||
"};");
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::var' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:7]: (warning) Member variable 'Fred::var' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("class Fred\n"
|
||||
"{\n"
|
||||
|
@ -864,7 +864,7 @@ private:
|
|||
"};\n"
|
||||
"Fred::Fred() { };\n"
|
||||
"Fred::Fred(const Fred &) { };\n");
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Fred::var' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:10]: (warning) Member variable 'Fred::var' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void initvar_nested_constructor() // ticket #1375
|
||||
|
@ -892,11 +892,11 @@ private:
|
|||
"A::B::B(int x){}\n"
|
||||
"A::B::C::C(int y){}\n"
|
||||
"A::B::C::D::D(int z){}\n");
|
||||
ASSERT_EQUALS("[test.cpp:20]: (warning) Member variable 'A::a' is not initialised in the constructor.\n"
|
||||
"[test.cpp:20]: (warning) Member variable 'A::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'B::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'C::c' is not initialised in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'D::d' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:20]: (warning) Member variable 'A::a' is not initialized in the constructor.\n"
|
||||
"[test.cpp:20]: (warning) Member variable 'A::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'B::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'C::c' is not initialized in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'D::d' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("class A {\n"
|
||||
"public:\n"
|
||||
|
@ -921,11 +921,11 @@ private:
|
|||
"A::B::B(int x){}\n"
|
||||
"A::B::C::C(int y){}\n"
|
||||
"A::B::C::D::D(const A::B::C::D & d){}\n");
|
||||
ASSERT_EQUALS("[test.cpp:20]: (warning) Member variable 'A::a' is not initialised in the constructor.\n"
|
||||
"[test.cpp:20]: (warning) Member variable 'A::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'B::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'C::c' is not initialised in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'D::d' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:20]: (warning) Member variable 'A::a' is not initialized in the constructor.\n"
|
||||
"[test.cpp:20]: (warning) Member variable 'A::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'B::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'C::c' is not initialized in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'D::d' is not initialized in the constructor.\n", errout.str());
|
||||
|
||||
check("class A {\n"
|
||||
"public:\n"
|
||||
|
@ -951,11 +951,11 @@ private:
|
|||
"A::B::B(int x){}\n"
|
||||
"A::B::C::C(int y){}\n"
|
||||
"A::B::C::D::D(const A::B::C::D::E & e){}\n");
|
||||
ASSERT_EQUALS("[test.cpp:21]: (warning) Member variable 'A::a' is not initialised in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'A::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'B::b' is not initialised in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'C::c' is not initialised in the constructor.\n"
|
||||
"[test.cpp:24]: (warning) Member variable 'D::d' is not initialised in the constructor.\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:21]: (warning) Member variable 'A::a' is not initialized in the constructor.\n"
|
||||
"[test.cpp:21]: (warning) Member variable 'A::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:22]: (warning) Member variable 'B::b' is not initialized in the constructor.\n"
|
||||
"[test.cpp:23]: (warning) Member variable 'C::c' is not initialized in the constructor.\n"
|
||||
"[test.cpp:24]: (warning) Member variable 'D::d' is not initialized in the constructor.\n", errout.str());
|
||||
}
|
||||
|
||||
void initvar_nocopy1() // ticket #2474
|
||||
|
@ -989,7 +989,7 @@ private:
|
|||
" A(const A&){}\n"
|
||||
" const A& operator=(const A&){return *this;}\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:12]: (warning) Member variable 'A::m_SemVar' is not initialised in the constructor.\n"
|
||||
ASSERT_EQUALS("[test.cpp:12]: (warning) Member variable 'A::m_SemVar' is not initialized in the constructor.\n"
|
||||
"[test.cpp:13]: (warning) Member variable 'A::m_SemVar' is not assigned a value in 'A::operator='\n", errout.str());
|
||||
|
||||
check("class A\n"
|
||||
|
@ -1000,7 +1000,7 @@ private:
|
|||
" A(const A&){}\n"
|
||||
" const A& operator=(const A&){return *this;}\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'A::m_SemVar' is not initialised in the constructor.\n"
|
||||
ASSERT_EQUALS("[test.cpp:6]: (warning) Member variable 'A::m_SemVar' is not initialized in the constructor.\n"
|
||||
"[test.cpp:7]: (warning) Member variable 'A::m_SemVar' is not assigned a value in 'A::operator='\n", errout.str());
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1035,7 @@ private:
|
|||
" A(const A&){}\n"
|
||||
" const A& operator=(const A&){return *this;}\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("[test.cpp:12]: (warning) Member variable 'A::m_SemVar' is not initialised in the constructor.\n"
|
||||
ASSERT_EQUALS("[test.cpp:12]: (warning) Member variable 'A::m_SemVar' is not initialized in the constructor.\n"
|
||||
"[test.cpp:13]: (warning) Member variable 'A::m_SemVar' is not assigned a value in 'A::operator='\n", errout.str());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue