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 parse #define, bad macro syntax\n", toString(outputList));
914
924
}
915
925
926
+
staticvoiddefine_invalid_3()
927
+
{
928
+
constchar code[] = "#if'\\u'";
929
+
simplecpp::OutputList outputList;
930
+
ASSERT_EQUALS("", preprocess(code, &outputList));
931
+
ASSERT_EQUALS("file0,1,syntax_error,failed to evaluate #if condition, expected digit\n", toString(outputList));
932
+
}
933
+
934
+
staticvoiddefine_invalid_4()
935
+
{
936
+
constchar code[] = "#define R()\n"
937
+
"R";
938
+
simplecpp::OutputList outputList;
939
+
ASSERT_EQUALS("", preprocess(code, &outputList));
940
+
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'R', Wrong number of parameters for macro 'R'.\n", toString(outputList));
941
+
}
942
+
943
+
staticvoiddefine_invalid_5()
944
+
{
945
+
constchar code[] = "#define X(...)\n"
946
+
"X";
947
+
simplecpp::OutputList outputList;
948
+
ASSERT_EQUALS("", preprocess(code, &outputList));
949
+
ASSERT_EQUALS("file0,2,syntax_error,failed to expand 'X', Wrong number of parameters for macro 'X'.\n", toString(outputList));
950
+
}
951
+
952
+
staticvoiddefine_invalid_6()
953
+
{
954
+
constchar code[] = "#if-0xBBB4444444444444%~B";
955
+
simplecpp::OutputList outputList;
956
+
ASSERT_EQUALS("", preprocess(code, &outputList));
957
+
ASSERT_EQUALS("file0,1,syntax_error,failed to evaluate #if condition, division overflow\n", toString(outputList));
958
+
}
959
+
960
+
staticvoiddefine_invalid_7()
961
+
{
962
+
constchar code[] = "#define A)__has_include\n"
963
+
"#if\u000BA";
964
+
simplecpp::OutputList outputList;
965
+
ASSERT_EQUALS("", preprocess(code, &outputList));
966
+
ASSERT_EQUALS("file0,2,syntax_error,failed to evaluate #if condition, missing __has_include argument\n", toString(outputList));
967
+
}
968
+
969
+
staticvoiddefine_invalid_8()
970
+
{
971
+
constchar code[] = "#define f __has_include\n"
972
+
"#if#f<";
973
+
simplecpp::OutputList outputList;
974
+
ASSERT_EQUALS("", preprocess(code, &outputList));
975
+
ASSERT_EQUALS("file0,2,syntax_error,failed to evaluate #if condition, missing __has_include argument\n", toString(outputList));
976
+
}
977
+
978
+
staticvoiddefine_invalid_9()
979
+
{
980
+
constchar code[] = "#if@u'\\udefa'";
981
+
simplecpp::OutputList outputList;
982
+
ASSERT_EQUALS("", preprocess(code, &outputList));
983
+
ASSERT_EQUALS("file0,1,syntax_error,failed to evaluate #if condition, surrogate code points not allowed in universal character names\n", toString(outputList));
0 commit comments