args -> format_args
This commit is contained in:
@@ -29,7 +29,7 @@ class CustomArgFormatter : public fmt::arg_formatter<char> {
|
||||
}
|
||||
};
|
||||
|
||||
std::string custom_vformat(fmt::string_view format_str, fmt::args args) {
|
||||
std::string custom_vformat(fmt::string_view format_str, fmt::format_args args) {
|
||||
fmt::memory_buffer buffer;
|
||||
// Pass custom argument formatter as a template arg to vwrite.
|
||||
fmt::vformat_to<CustomArgFormatter>(buffer, format_str, args);
|
||||
|
||||
+2
-2
@@ -1425,7 +1425,7 @@ TEST(StrTest, Convert) {
|
||||
EXPECT_EQ("2012-12-9", s);
|
||||
}
|
||||
|
||||
std::string vformat_message(int id, const char *format, fmt::args args) {
|
||||
std::string vformat_message(int id, const char *format, fmt::format_args args) {
|
||||
fmt::memory_buffer buffer;
|
||||
format_to(buffer, "[{}] ", id);
|
||||
vformat_to(buffer, format, args);
|
||||
@@ -1512,7 +1512,7 @@ class MockArgFormatter : public fmt::internal::arg_formatter_base<char> {
|
||||
void operator()(fmt::basic_arg<fmt::context>::handle) {}
|
||||
};
|
||||
|
||||
void custom_vformat(fmt::string_view format_str, fmt::args args) {
|
||||
void custom_vformat(fmt::string_view format_str, fmt::format_args args) {
|
||||
fmt::memory_buffer buffer;
|
||||
fmt::vformat_to<MockArgFormatter>(buffer, format_str, args);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ struct TestArgFormatter : fmt::arg_formatter<char> {
|
||||
|
||||
TEST(OStreamTest, CustomArg) {
|
||||
fmt::memory_buffer buffer;
|
||||
fmt::context ctx("", fmt::args());
|
||||
fmt::context ctx("", fmt::format_args());
|
||||
fmt::format_specs spec;
|
||||
TestArgFormatter af(buffer, ctx, spec);
|
||||
visit(af, fmt::internal::make_arg<fmt::context>(TestEnum()));
|
||||
|
||||
+3
-3
@@ -427,7 +427,7 @@ TEST(UtilTest, Increment) {
|
||||
}
|
||||
|
||||
TEST(UtilTest, FormatArgs) {
|
||||
fmt::args args;
|
||||
fmt::format_args args;
|
||||
EXPECT_FALSE(args[1]);
|
||||
}
|
||||
|
||||
@@ -456,7 +456,7 @@ TEST(UtilTest, MakeValueWithCustomFormatter) {
|
||||
fmt::internal::value<CustomContext> arg(t);
|
||||
CustomContext ctx = {false};
|
||||
fmt::memory_buffer buffer;
|
||||
arg.custom.format(buffer, &t, &ctx);
|
||||
arg.custom.format(buffer, &t, ctx);
|
||||
EXPECT_TRUE(ctx.called);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ TEST(UtilTest, CustomArg) {
|
||||
testing::StrictMock<visitor> v;
|
||||
EXPECT_CALL(v, visit(_)).WillOnce(testing::Invoke([&](handle h) {
|
||||
fmt::memory_buffer buffer;
|
||||
fmt::context ctx("", fmt::args());
|
||||
fmt::context ctx("", fmt::format_args());
|
||||
h.format(buffer, ctx);
|
||||
EXPECT_EQ("test", std::string(buffer.data(), buffer.size()));
|
||||
return visitor::Result();
|
||||
|
||||
Reference in New Issue
Block a user