Apply clang-format
This commit is contained in:
+3
-3
@@ -375,8 +375,8 @@ struct check_custom {
|
||||
void grow(size_t) {}
|
||||
} buffer;
|
||||
fmt::format_parse_context parse_ctx("");
|
||||
fmt::format_context ctx{
|
||||
fmt::detail::buffer_appender<char>(buffer), fmt::format_args()};
|
||||
fmt::format_context ctx{fmt::detail::buffer_appender<char>(buffer),
|
||||
fmt::format_args()};
|
||||
h.format(parse_ctx, ctx);
|
||||
EXPECT_EQ("test", std::string(buffer.data, buffer.size()));
|
||||
return test_result();
|
||||
@@ -386,7 +386,7 @@ struct check_custom {
|
||||
TEST(ArgTest, CustomArg) {
|
||||
test_struct test;
|
||||
using visitor =
|
||||
mock_visitor<fmt::basic_format_arg<fmt::format_context>::handle>;
|
||||
mock_visitor<fmt::basic_format_arg<fmt::format_context>::handle>;
|
||||
testing::StrictMock<visitor> v;
|
||||
EXPECT_CALL(v, visit(_)).WillOnce(testing::Invoke(check_custom()));
|
||||
fmt::visit_format_arg(v, make_arg<fmt::format_context>(test));
|
||||
|
||||
@@ -24,8 +24,7 @@ class custom_arg_formatter
|
||||
|
||||
custom_arg_formatter(fmt::format_context& ctx,
|
||||
fmt::format_parse_context* parse_ctx,
|
||||
fmt::format_specs* s = nullptr,
|
||||
const char* = nullptr)
|
||||
fmt::format_specs* s = nullptr, const char* = nullptr)
|
||||
: base(ctx, parse_ctx, s) {}
|
||||
|
||||
using base::operator();
|
||||
@@ -41,7 +40,7 @@ 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<custom_arg_formatter>(
|
||||
fmt::detail::buffer_appender<char>(buffer), format_str, args);
|
||||
fmt::detail::buffer_appender<char>(buffer), format_str, args);
|
||||
return std::string(buffer.data(), buffer.size());
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -288,8 +288,8 @@ TEST(BufferedFileTest, Fileno) {
|
||||
}
|
||||
|
||||
TEST(DirectBufferedFileTest, Print) {
|
||||
fmt::direct_buffered_file out(
|
||||
"test-file", fmt::file::WRONLY | fmt::file::CREATE);
|
||||
fmt::direct_buffered_file out("test-file",
|
||||
fmt::file::WRONLY | fmt::file::CREATE);
|
||||
fmt::print(out, "The answer is {}.\n", 42);
|
||||
out.close();
|
||||
file in("test-file", file::RDONLY);
|
||||
@@ -298,8 +298,8 @@ TEST(DirectBufferedFileTest, Print) {
|
||||
|
||||
TEST(DirectBufferedFileTest, BufferBoundary) {
|
||||
auto str = std::string(4096, 'x');
|
||||
fmt::direct_buffered_file out(
|
||||
"test-file", fmt::file::WRONLY | fmt::file::CREATE);
|
||||
fmt::direct_buffered_file out("test-file",
|
||||
fmt::file::WRONLY | fmt::file::CREATE);
|
||||
fmt::print(out, "{}", str);
|
||||
fmt::print(out, "{}", str);
|
||||
out.close();
|
||||
|
||||
@@ -75,8 +75,8 @@ struct test_arg_formatter
|
||||
|
||||
TEST(OStreamTest, CustomArg) {
|
||||
fmt::memory_buffer buffer;
|
||||
fmt::format_context ctx(
|
||||
fmt::detail::buffer_appender<char>{buffer}, fmt::format_args());
|
||||
fmt::format_context ctx(fmt::detail::buffer_appender<char>{buffer},
|
||||
fmt::format_args());
|
||||
fmt::format_specs spec;
|
||||
test_arg_formatter af(ctx, spec);
|
||||
fmt::visit_format_arg(
|
||||
|
||||
Reference in New Issue
Block a user