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,2,portability_line_directive,Line number out of range: 0.\n",
2878
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 0. Line number zero is undefined behavior.\n",
2873
2879
toString(outputList));
2874
2880
}
2875
2881
@@ -2888,7 +2894,7 @@ static void lineDirective()
2888
2894
";\n";
2889
2895
simplecpp::OutputList outputList;
2890
2896
makeTokenList(code, dui, &outputList);
2891
-
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 32768.\n",
2897
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 32768. Line numbers above 32767 are undefined behavior in " + std_name + ".\n",
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 18446744073709551617.\n",
2907
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 18446744073709551617. Line numbers above 32767 are undefined behavior in " + std_name + ".\n",
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 0.\n",
2928
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 0. Line number zero is undefined behavior.\n",
2929
+
toString(outputList));
2930
+
}
2931
+
2932
+
{
2933
+
constchar code[] =
2934
+
"#line 32767\n"
2935
+
";\n";
2936
+
simplecpp::OutputList outputList;
2937
+
makeTokenList(code, dui, &outputList);
2938
+
ASSERT_EQUALS("", toString(outputList));
2939
+
}
2940
+
2941
+
{
2942
+
constchar code[] =
2943
+
"#line 32768\n"
2944
+
";\n";
2945
+
simplecpp::OutputList outputList;
2946
+
makeTokenList(code, dui, &outputList);
2947
+
ASSERT_EQUALS("", toString(outputList));
2948
+
}
2949
+
2950
+
{
2951
+
constchar code[] =
2952
+
"#line 2147483647\n"
2953
+
";\n";
2954
+
simplecpp::OutputList outputList;
2955
+
makeTokenList(code, dui, &outputList);
2956
+
ASSERT_EQUALS("", toString(outputList));
2957
+
}
2958
+
2959
+
{
2960
+
constchar code[] =
2961
+
"#line 2147483648\n"
2962
+
";\n";
2963
+
simplecpp::OutputList outputList;
2964
+
makeTokenList(code, dui, &outputList);
2965
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 2147483648. Line numbers above 2147483647 are undefined behavior in " + std_name + ".\n",
2966
+
toString(outputList));
2967
+
}
2968
+
2969
+
{
2970
+
constchar code[] =
2971
+
"#line 18446744073709551617\n"// 2^64 + 1
2972
+
";\n";
2973
+
simplecpp::OutputList outputList;
2974
+
makeTokenList(code, dui, &outputList);
2975
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 18446744073709551617. Line numbers above 2147483647 are undefined behavior in " + std_name + ".\n",
2976
+
toString(outputList));
2977
+
}
2978
+
}
2979
+
2980
+
{
2981
+
std::string std_name = "C++26";
2982
+
2983
+
simplecpp::DUI dui;
2984
+
dui.std = "c++26";
2985
+
2986
+
{
2987
+
constchar code[] =
2988
+
"#line 0\n"
2989
+
";\n";
2990
+
simplecpp::OutputList outputList;
2991
+
makeTokenList(code, dui, &outputList);
2992
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 0. Line number zero is undefined behavior.\n",
2917
2993
toString(outputList));
2918
2994
}
2919
2995
@@ -2950,7 +3026,7 @@ static void lineDirective()
2950
3026
";\n";
2951
3027
simplecpp::OutputList outputList;
2952
3028
makeTokenList(code, dui, &outputList);
2953
-
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 2147483648.\n",
3029
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 2147483648. Line numbers above 2147483647 are conditionally supported in " + std_name + ".\n",
2954
3030
toString(outputList));
2955
3031
}
2956
3032
@@ -2960,7 +3036,7 @@ static void lineDirective()
2960
3036
";\n";
2961
3037
simplecpp::OutputList outputList;
2962
3038
makeTokenList(code, dui, &outputList);
2963
-
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 18446744073709551617.\n",
3039
+
ASSERT_EQUALS("file0,2,portability_line_directive,Line number out of range: 18446744073709551617. Line numbers above 2147483647 are conditionally supported in " + std_name + ".\n",
0 commit comments