From d1af0b6478f31efe74dd0f2db8a63a67258ecdcf Mon Sep 17 00:00:00 2001 From: Leandro Penz Date: Wed, 11 Feb 2009 15:16:32 +0000 Subject: [PATCH] Incomplete statement: test case for statement that begins with numeric constant. --- test/testincompletestatement.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/testincompletestatement.cpp b/test/testincompletestatement.cpp index 31644f3c3..f2530a0f4 100644 --- a/test/testincompletestatement.cpp +++ b/test/testincompletestatement.cpp @@ -62,6 +62,7 @@ private: TEST_CASE(test2); TEST_CASE(test3); TEST_CASE(test4); + TEST_CASE(test5); TEST_CASE(test_numeric); // TODO TEST_CASE(intarray); } @@ -116,6 +117,16 @@ private: ASSERT_EQUALS(std::string(""), errout.str()); } + void test5() + { + check("void foo()\n" + "{\n" + " 50;\n" + "}\n"); + + ASSERT_EQUALS(std::string("[test.cpp:3]: (style) Redundant code: Found a statement that begins with numeric constant\n"), errout.str()); + } + void test_numeric() { check("struct P\n"