mirror of
https://github.com/fmtlib/fmt.git
synced 2025-04-16 05:42:19 +00:00
Fix a warning
This commit is contained in:
parent
b10ccb83e1
commit
b31680990e
@ -718,7 +718,7 @@ TEST(FormatToTest, WideString) {
|
|||||||
|
|
||||||
TEST(FormatToTest, FormatToNonbackInsertIteratorWithSignAndNumericAlignment) {
|
TEST(FormatToTest, FormatToNonbackInsertIteratorWithSignAndNumericAlignment) {
|
||||||
char buffer[16] = {};
|
char buffer[16] = {};
|
||||||
fmt::format_to(buffer, "{: =+}", 42.0);
|
fmt::format_to(fmt::internal::make_checked(buffer, 16), "{: =+}", 42.0);
|
||||||
EXPECT_STREQ("+42", buffer);
|
EXPECT_STREQ("+42", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1633,7 +1633,8 @@ TEST(FormatterTest, CustomFormat) {
|
|||||||
|
|
||||||
TEST(FormatterTest, CustomFormatTo) {
|
TEST(FormatterTest, CustomFormatTo) {
|
||||||
char buf[10] = {};
|
char buf[10] = {};
|
||||||
auto end = fmt::format_to(buf, "{}", Answer());
|
auto end = &*fmt::format_to(
|
||||||
|
fmt::internal::make_checked(buf, 10), "{}", Answer());
|
||||||
EXPECT_EQ(end, buf + 2);
|
EXPECT_EQ(end, buf + 2);
|
||||||
EXPECT_STREQ(buf, "42");
|
EXPECT_STREQ(buf, "42");
|
||||||
}
|
}
|
||||||
|
@ -147,11 +147,10 @@ TEST(OStreamTest, WriteToOStreamMaxSize) {
|
|||||||
|
|
||||||
testing::InSequence sequence;
|
testing::InSequence sequence;
|
||||||
const char *data = FMT_NULL;
|
const char *data = FMT_NULL;
|
||||||
std::size_t size = max_size;
|
|
||||||
do {
|
|
||||||
typedef std::make_unsigned<std::streamsize>::type ustreamsize;
|
typedef std::make_unsigned<std::streamsize>::type ustreamsize;
|
||||||
ustreamsize n = std::min<ustreamsize>(
|
ustreamsize size = max_size;
|
||||||
size, fmt::internal::to_unsigned(max_streamsize));
|
do {
|
||||||
|
auto n = std::min(size, fmt::internal::to_unsigned(max_streamsize));
|
||||||
EXPECT_CALL(streambuf, xsputn(data, static_cast<std::streamsize>(n)))
|
EXPECT_CALL(streambuf, xsputn(data, static_cast<std::streamsize>(n)))
|
||||||
.WillOnce(testing::Return(max_streamsize));
|
.WillOnce(testing::Return(max_streamsize));
|
||||||
data += n;
|
data += n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user