ValueFlow: relocate test

This commit is contained in:
Daniel Marjamäki 2014-08-27 17:11:38 +02:00
parent ae8a20b197
commit febbd92fbd
1 changed files with 9 additions and 9 deletions

View File

@ -811,6 +811,15 @@ private:
"}";
ASSERT_EQUALS(false, testValueOfX(code, 6U, 0)); // x is not 0 at line 6
code = "void f(int x1) {\n" // #6086
" int x = x1;\n"
" if (x1 >= 3) {\n"
" return;\n"
" }\n"
" a = x;\n" // <- x is not 3
"}";
ASSERT_EQUALS(false, testValueOfX(code, 6U, 3));
// break
code = "void f() {\n"
" for (;;) {\n"
@ -1007,15 +1016,6 @@ private:
"}";
ASSERT_EQUALS(false, testValueOfX(code, 5U, 5));
code = "void f(int x1) {\n" // #6086
" int x = x1;\n"
" if (x1 >= 3) {\n"
" return;\n"
" }\n"
" a = x;\n"
"}";
ASSERT_EQUALS(false, testValueOfX(code, 6U, 3));
// TODO: float
code = "void f(float x) {\n"
" if (x == 0.5) {}\n"