diff --git a/test/testclass.cpp b/test/testclass.cpp index dc42b3813..5091d4cb5 100644 --- a/test/testclass.cpp +++ b/test/testclass.cpp @@ -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());