Robert Reif <reif@earthlink.net>

refactoring chained assignments
This commit is contained in:
Daniel Marjamäki 2010-05-05 19:34:03 +02:00
parent af4c4cef34
commit 95f3533252
1 changed files with 2 additions and 6 deletions

View File

@ -895,13 +895,9 @@ private:
functionVariableUsage("void foo()\n" functionVariableUsage("void foo()\n"
"{\n" "{\n"
" int a, b, c;\n" " int a, b, c;\n"
" a = b = c = 0;\n" " a = b = c = f();\n"
"}\n"); "}\n");
ASSERT_EQUALS( ASSERT_EQUALS("[test.cpp:3]: (style) Variable 'a' is assigned a value that is never used\n", errout.str());
"[test.cpp:3]: (style) Variable 'a' is assigned a value that is never used\n"
"[test.cpp:3]: (style) Variable 'b' is assigned a value that is never used\n"
"[test.cpp:3]: (style) Variable 'c' is assigned a value that is never used\n",
errout.str());
functionVariableUsage("int * foo()\n" functionVariableUsage("int * foo()\n"
"{\n" "{\n"