Added TODO testcase for ticket #1169 (improve check: divsion by zero not detected when using the shift (>>) operator)

This commit is contained in:
Daniel Marjamäki 2010-04-04 18:48:51 +02:00
parent abceff497b
commit ba2843883b
1 changed files with 21 additions and 0 deletions

View File

@ -99,6 +99,7 @@ private:
TEST_CASE(simplifyKnownVariables19);
TEST_CASE(simplifyKnownVariables20);
TEST_CASE(simplifyKnownVariables21);
TEST_CASE(simplifyKnownVariables22);
TEST_CASE(match1);
@ -1057,6 +1058,26 @@ private:
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()
{
// Match "%var% | %var%"