removeRedundantConditions : Added a simple test case for "else if (false)"

This commit is contained in:
Daniel Marjamäki 2008-12-26 15:46:59 +00:00
parent 79519f5bde
commit 8a02641ffd
1 changed files with 6 additions and 0 deletions

View File

@ -131,6 +131,12 @@ private:
const char code2[] = " void f() { if( aa ) { a=0; } else { a=1; } } ";
ASSERT_EQUALS( tok(code2), tok(code1) );
}
{
const char code1[] = " void f() { if( aa ) { a=0; } else if( false ) a=1; else { a=2; } } ";
const char code2[] = " void f() { if( aa ) { a=0; } else { a=2; } } ";
ASSERT_EQUALS( tok(code2), tok(code1) );
}
}
};