Added TODO testcase for ticket #1169 (improve check: divsion by zero not detected when using the shift (>>) operator)
This commit is contained in:
parent
abceff497b
commit
ba2843883b
|
@ -99,6 +99,7 @@ private:
|
||||||
TEST_CASE(simplifyKnownVariables19);
|
TEST_CASE(simplifyKnownVariables19);
|
||||||
TEST_CASE(simplifyKnownVariables20);
|
TEST_CASE(simplifyKnownVariables20);
|
||||||
TEST_CASE(simplifyKnownVariables21);
|
TEST_CASE(simplifyKnownVariables21);
|
||||||
|
TEST_CASE(simplifyKnownVariables22);
|
||||||
|
|
||||||
TEST_CASE(match1);
|
TEST_CASE(match1);
|
||||||
|
|
||||||
|
@ -1057,6 +1058,26 @@ private:
|
||||||
simplifyKnownVariables(code));
|
simplifyKnownVariables(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void simplifyKnownVariables22()
|
||||||
|
{
|
||||||
|
// This testcase is related to ticket #1169
|
||||||
|
const char code[] = "void foo()\n"
|
||||||
|
"{\n"
|
||||||
|
" int n = 10;\n"
|
||||||
|
" i = (n >> 1);\n"
|
||||||
|
"}\n";
|
||||||
|
|
||||||
|
// Wanted result - Ticket #1169 can probably be closed when this works
|
||||||
|
TODO_ASSERT_EQUALS(
|
||||||
|
"void foo ( ) { int n ; n = 10 ; i = ( 10 >> 1 ) ; }",
|
||||||
|
simplifyKnownVariables(code));
|
||||||
|
|
||||||
|
// Current result
|
||||||
|
ASSERT_EQUALS(
|
||||||
|
"void foo ( ) { int n ; n = 10 ; i = ( n >> 1 ) ; }",
|
||||||
|
simplifyKnownVariables(code));
|
||||||
|
}
|
||||||
|
|
||||||
void match1()
|
void match1()
|
||||||
{
|
{
|
||||||
// Match "%var% | %var%"
|
// Match "%var% | %var%"
|
||||||
|
|
Loading…
Reference in New Issue