You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'CON', Invalid ## usage when expanding 'CON'.\n", toString(outputList));
853
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'CON', Invalid ## usage when expanding 'CON': Unexpected newline\n", toString(outputList));
854
854
}
855
855
856
856
staticvoidgarbage_endif()
@@ -994,19 +994,19 @@ static void hashhash9()
994
994
"A";
995
995
outputList.clear();
996
996
ASSERT_EQUALS("", preprocess(code, &outputList));
997
-
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A'.\n", toString(outputList));
997
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A': Pasting '+' and 'x' yields an invalid token.\n", toString(outputList));
998
998
999
999
code = "#define A 2##=\n"
1000
1000
"A";
1001
1001
outputList.clear();
1002
1002
ASSERT_EQUALS("", preprocess(code, &outputList));
1003
-
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A'.\n", toString(outputList));
1003
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A': Pasting '2' and '=' yields an invalid token.\n", toString(outputList));
1004
1004
1005
1005
code = "#define A <<##x\n"
1006
1006
"A";
1007
1007
outputList.clear();
1008
1008
ASSERT_EQUALS("", preprocess(code, &outputList));
1009
-
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A'.\n", toString(outputList));
1009
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'A', Invalid ## usage when expanding 'A': Pasting '<<' and 'x' yields an invalid token.\n", toString(outputList));
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'f', Invalid ## usage when expanding 'f'.\n", toString(outputList));
1178
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'f', Invalid ## usage when expanding 'f': Unexpected token '('\n", toString(outputList));
1179
1179
}
1180
1180
1181
1181
staticvoidhashhash_invalid_2()
1182
1182
{
1183
1183
constchar code[] = "#define f(a) (x##)\nf(1)";
1184
1184
simplecpp::OutputList outputList;
1185
1185
ASSERT_EQUALS("", preprocess(code, &outputList));
1186
-
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'f', Invalid ## usage when expanding 'f'.\n", toString(outputList));
1186
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'f', Invalid ## usage when expanding 'f': Unexpected token ')'\n", toString(outputList));
1187
1187
}
1188
1188
1189
-
staticvoidhashhash_invalid_3()
1189
+
staticvoidhashhash_invalid_string_number()
1190
1190
{
1191
1191
constchar code[] =
1192
1192
"#define BAD(x) x##12345\nBAD(\"ABC\")";
1193
1193
1194
1194
simplecpp::OutputList outputList;
1195
1195
preprocess(code, simplecpp::DUI(), &outputList);
1196
-
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'BAD', Invalid ## usage when expanding 'BAD'.\n", toString(outputList));
1196
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'BAD', Invalid ## usage when expanding 'BAD': Pasting '\"ABC\"' and '12345' yields an invalid token.\n", toString(outputList));
1197
+
}
1198
+
1199
+
staticvoidhashhash_invalid_missing_args()
1200
+
{
1201
+
constchar code[] =
1202
+
"#define BAD(x) ##x\nBAD()";
1203
+
1204
+
simplecpp::OutputList outputList;
1205
+
preprocess(code, simplecpp::DUI(), &outputList);
1206
+
ASSERT_EQUALS("file0,1,syntax_error,failed to expand 'BAD', Invalid ## usage when expanding 'BAD': Missing first argument\n", toString(outputList));
1197
1207
}
1198
1208
1199
1209
staticvoidhas_include_1()
@@ -2427,7 +2437,8 @@ int main(int argc, char **argv)
0 commit comments