Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added few missing format cases for zero and blank space padding #2016

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions test_conformance/printf/util_printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ std::vector<printDataGenParameters> printIntGenParameters = {
//(Minimum)Six-wide,Five-digit(zero-filled in absent
// digits),default(right)-justified

{ { "%06.5i" }, "100" }
{ { "%06.5i" }, "100" },

//(Minimum)Ten-wide, left-justified, with a blank space inserted before the
// value

{ { "% 10d" }, "42" },
};

//-----------------------------------------------
Expand Down Expand Up @@ -165,6 +169,16 @@ std::vector<printDataGenParameters> printHalfGenParameters = {
// exponent,left-justified,with sign,capital E,default(right)-justified

{ { "%+#21.15E" }, "-65504.0h" },

//(Minimum)Ten-wide,two positions after the decimal,with
// a blank space inserted before the value, default(right)-justified

{ { "% 10.2f" }, "1.25h" },

//(Minimum)Eight-wide,two positions after the decimal, with
// zeros inserted before the value, default(right)-justified

{ { "%08.2f" }, "3.14h" },
};

//---------------------------------------------------------
Expand Down Expand Up @@ -362,6 +376,16 @@ std::vector<printDataGenParameters> printFloatGenParameters = {
// xh.hhhhpAd style,default(right)-justified

{ { "%10.2a" }, "9990.235" },

//(Minimum)Ten-wide,two positions after the decimal,with
// a blank space inserted before the value, default(right)-justified

{ { "% 10.2f" }, "1.25" },

//(Minimum)Eight-wide,two positions after the decimal,with
// zeros inserted before the value, default(right)-justified

{ { "%08.2f" }, "3.14" },
};

//---------------------------------------------------------
Expand Down Expand Up @@ -490,8 +514,12 @@ std::vector<printDataGenParameters> printOctalGenParameters = {
//(Minimum)Four-wide,Five-digit,0-flag ignored(because of
// precision),default(right)-justified

{ { "%04.5o" }, "10" }
{ { "%04.5o" }, "10" },

//(Minimum)Ten-wide, zeros inserted before the value,
// default(right)-justified

{ { "%010o" }, "10" }
};

//-------------------------------------------------------
Expand Down
Loading