From c5b946f9b78183ef6040b7b3dca4201d00cab5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 23 May 2010 21:03:14 +0200 Subject: [PATCH] Unit Testing: Added a few more test cases related to ticket #1700 --- test/testclass.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) 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());