mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Test more length specifiers.
This commit is contained in:
parent
d3a7039e31
commit
ddd087d8d1
@ -333,7 +333,9 @@ void TestLength(const char *length_spec) {
|
|||||||
TestLength<T>(length_spec, -42);
|
TestLength<T>(length_spec, -42);
|
||||||
TestLength<T>(length_spec, min);
|
TestLength<T>(length_spec, min);
|
||||||
TestLength<T>(length_spec, max);
|
TestLength<T>(length_spec, max);
|
||||||
|
if (min > std::numeric_limits<fmt::LongLong>::min())
|
||||||
TestLength<T>(length_spec, fmt::LongLong(min) - 1);
|
TestLength<T>(length_spec, fmt::LongLong(min) - 1);
|
||||||
|
if (max < std::numeric_limits<fmt::LongLong>::max())
|
||||||
TestLength<T>(length_spec, fmt::LongLong(max) + 1);
|
TestLength<T>(length_spec, fmt::LongLong(max) + 1);
|
||||||
TestLength<T>(length_spec, std::numeric_limits<short>::min());
|
TestLength<T>(length_spec, std::numeric_limits<short>::min());
|
||||||
TestLength<T>(length_spec, std::numeric_limits<unsigned short>::max());
|
TestLength<T>(length_spec, std::numeric_limits<unsigned short>::max());
|
||||||
@ -355,9 +357,10 @@ TEST(PrintfTest, Length) {
|
|||||||
TestLength<unsigned short>("h");
|
TestLength<unsigned short>("h");
|
||||||
TestLength<long>("l");
|
TestLength<long>("l");
|
||||||
TestLength<unsigned long>("l");
|
TestLength<unsigned long>("l");
|
||||||
// TODO: more tests
|
TestLength<intmax_t>("j");
|
||||||
//EXPECT_EQ("-1", sprintf_int<unsigned char>("%hhd", UCHAR_MAX));
|
TestLength<std::size_t>("z");
|
||||||
//EXPECT_EQ("255", sprintf_int<unsigned char>("%hhu", UCHAR_MAX));
|
TestLength<std::ptrdiff_t>("t");
|
||||||
|
// TODO: test 'L' & 'll'
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: test type specifier
|
// TODO: test type specifier
|
||||||
|
Loading…
Reference in New Issue
Block a user