From 2058098a1c523dd694d9677e9ca05f1d42fc1522 Mon Sep 17 00:00:00 2001 From: Thomas Novotny Date: Wed, 21 Nov 2018 19:06:53 +0100 Subject: [PATCH] replace return type with auto to hopefully fix vs2013 compile error remove some whitespace --- test/printf-test.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/printf-test.cc b/test/printf-test.cc index 77af6684..3b839b99 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -502,7 +502,7 @@ TEST(PrintfTest, OStream) { TEST(PrintfTest, VPrintf) { fmt::format_arg_store as{42}; - fmt::basic_format_args args( as ); + fmt::basic_format_args args(as); EXPECT_EQ(fmt::vsprintf("%d", args), "42"); EXPECT_WRITE(stdout, fmt::vprintf("%d", args), "42"); EXPECT_WRITE(stdout, fmt::vfprintf(stdout, "%d", args), "42"); @@ -518,18 +518,17 @@ TEST(PrintfTest, CheckFormatStringRegression) { check_format_string_regression("%c%s", 'x', ""); } -TEST( PrintfTest, VSPrintfMakeArgsExample ) { +TEST(PrintfTest, VSPrintfMakeArgsExample) { fmt::format_arg_store as{42, "something"}; fmt::basic_format_args args(as); EXPECT_EQ( "[42] something happened", fmt::vsprintf("[%d] %s happened", args)); - fmt::format_arg_store as2 = - fmt::make_printf_args(42, "something"); + auto as2 = fmt::make_printf_args(42, "something"); fmt::basic_format_args args2(as2); EXPECT_EQ( "[42] something happened", fmt::vsprintf("[%d] %s happened", args2)); - //the older gcc versions can"t cast the return value + //the older gcc versions can't cast the return value #if !defined(__GNUC__) || (__GNUC__ > 4) EXPECT_EQ( "[42] something happened", @@ -538,18 +537,18 @@ TEST( PrintfTest, VSPrintfMakeArgsExample ) { #endif } -TEST( PrintfTest, VSPrintfMakeWArgsExample ) { +TEST(PrintfTest, VSPrintfMakeWArgsExample) { fmt::format_arg_store as{ 42,L"something"}; fmt::basic_format_args args(as); EXPECT_EQ( L"[42] something happened", fmt::vsprintf(L"[%d] %s happened", args)); - fmt::format_arg_store as2 = - fmt::make_wprintf_args(42, L"something"); - fmt::basic_format_args args2( as2 ); + auto as2 = fmt::make_wprintf_args(42, L"something"); + fmt::basic_format_args args2(as2); EXPECT_EQ( L"[42] something happened", fmt::vsprintf(L"[%d] %s happened", args2)); + // the older gcc versions can't cast the return value #if !defined(__GNUC__) || (__GNUC__ > 4) EXPECT_EQ( L"[42] something happened",