testunusedvar.cpp: remove test cases that has undefined behavior

This commit is contained in:
Daniel Marjamäki 2021-05-14 11:06:44 +02:00
parent 45eb9f82a0
commit ffac1d1b00
1 changed files with 0 additions and 21 deletions

View File

@ -2801,12 +2801,6 @@ private:
"}", "test.c");
ASSERT_EQUALS("[test.c:3]: (style) Variable 'c' is assigned a value that is never used.\n", errout.str());
functionVariableUsage("void f(int c) {\n"
" int x;\n"
" if (c >> x) {}\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (style) Variable 'x' is not assigned a value.\n", errout.str());
functionVariableUsage("void f() {\n"
" int x, y;\n"
" std::cin >> x >> y;\n"
@ -2819,12 +2813,6 @@ private:
" c & x;\n"
"}");
ASSERT_EQUALS("", errout.str());
functionVariableUsage("void f(int c) {\n"
" int x;\n"
" c & x;\n"
"}");
ASSERT_EQUALS("[test.cpp:2]: (style) Variable 'x' is not assigned a value.\n", errout.str());
}
void localvar33() { // ticket #2345
@ -3483,15 +3471,6 @@ private:
// extracttests.start: int a[10];
functionVariableUsage("void foo()\n"
"{\n"
" int *b = a;\n"
" int *c;\n"
" *c = b[0];\n"
"}");
ASSERT_EQUALS("[test.cpp:4]: (style) Variable 'c' is not assigned a value.\n", errout.str());
functionVariableUsage("int a[10];\n"
"void foo()\n"
"{\n"
" int *b = a;\n"
" int c = b[0];\n"