diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index cbb78f94c..f974b8cfa 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -184,6 +184,48 @@ private: "}\n"; ASSERT_EQUALS("void foo ( int a ) { a = a + a ; } ", tok(code1)); } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a+++b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a ++ + b ; } ", tok(code1)); + } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a---b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a -- - b ; } ", tok(code1)); + } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a--+b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a -- + b ; } ", tok(code1)); + } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a++-b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a ++ - b ; } ", tok(code1)); + } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a+--b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a + -- b ; } ", tok(code1)); + } + { + const char code1[] = "void foo( int a, int b )\n" + "{\n" + "a=a-++b;\n" + "}\n"; + ASSERT_EQUALS("void foo ( int a ) { a = a - ++ b ; } ", tok(code1)); + } } };