Tokenizer::simplifyGoto: fixed unit tests

This commit is contained in:
Daniel Marjamäki 2011-07-03 18:35:11 +02:00
parent b143b283e9
commit 5561d81f0d
1 changed files with 0 additions and 63 deletions

View File

@ -2934,69 +2934,6 @@ private:
const char code[] = "void foo ( ) { int var ; var = x < y ? y : z ; } ;";
ASSERT_EQUALS(code, tok(code));
}
{
const char code[] = "void foo(int x)\n"
"{\n"
" goto A;\n"
"A:\n"
" fooA();\n"
" goto B;\n"
" fooNever();\n"
"B:\n"
" fooB();\n"
" return 3;\n"
"}";
const char expect[] = "void foo ( int x ) "
"{ "
"fooA ( ) ; "
"fooB ( ) ; "
"return 3 ; "
"fooA ( ) ; "
"fooB ( ) ; "
"return 3 ; "
"fooNever ( ) ; "
"fooB ( ) ; "
"return 3 ; "
"}";
ASSERT_EQUALS(expect, tok(code));
}
{
const char code[] = "void foo(int x)\n"
"{\n"
" goto A;\n"
"A:\n"
" fooA();\n"
" if( x ) { goto B; }\n"
" fooNever();\n"
"B:\n"
" fooB();\n"
" return 3;\n"
"}";
const char expect[] = "void foo ( int x ) "
"{ "
"fooA ( ) ; "
"if ( x ) { "
"fooB ( ) ; "
"return 3 ; } "
"fooNever ( ) ; "
"fooB ( ) ; "
"return 3 ; "
"fooA ( ) ; "
"if ( x ) { "
"fooB ( ) ; "
"return 3 ; } "
"fooNever ( ) ; "
"fooB ( ) ; "
"return 3 ; "
"}";
ASSERT_EQUALS(expect, tok(code));
}
}
void goto2()