Unit Testing: Added a few more test cases related to ticket #1700

This commit is contained in:
Daniel Marjamäki 2010-05-23 21:03:14 +02:00
parent bf8ef94f0c
commit c5b946f9b7
1 changed files with 47 additions and 2 deletions

View File

@ -1959,7 +1959,7 @@ private:
"{\n"
"class Foo {"
"public:\n"
" Foo() : i(0) { };\n"
" Foo() : i(0) { }\n"
"private:\n"
" int i;\n"
"};\n"
@ -1969,7 +1969,52 @@ private:
"{\n"
"class Foo {"
"public:\n"
" Foo() { };\n"
" Foo() { }\n"
"};\n"
"}\n");
ASSERT_EQUALS("", errout.str());
checkUninitVar("namespace n1\n"
"{\n"
"class Foo {"
"public:\n"
" Foo();\n"
"private:\n"
" int i;\n"
"};\n"
"}\n"
"\n"
"n1::Foo::Foo()\n"
"{ }\n"
"\n"
"namespace n2\n"
"{\n"
"class Foo {"
"public:\n"
" Foo() { }\n"
"};\n"
"}\n");
ASSERT_EQUALS("", errout.str());
TODO_ASSERT_EQUALS("uninitialized variable n1::i", errout.str());
checkUninitVar("namespace n1\n"
"{\n"
"class Foo {"
"public:\n"
" Foo();\n"
"private:\n"
" int i;\n"
"};\n"
"}\n"
"\n"
"n1::Foo::Foo() : i(0)\n"
"{ }\n"
"\n"
"namespace n2\n"
"{\n"
"class Foo {"
"public:\n"
" Foo() { }\n"
"};\n"
"}\n");
ASSERT_EQUALS("", errout.str());