From 7ca45f9f0ad655bd737099a3b3a40457f336b983 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Fri, 10 Jul 2020 07:59:47 +0200 Subject: [PATCH] Improve spacing in MessageLogger unit tests --- FWCore/MessageService/test/UnitTestClient_C.cc | 18 +++++++++--------- .../test/unit_test_outputs/u10_warnings.log | 12 ++++++------ .../test/unit_test_outputs/u6_warnings.log | 12 ++++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/FWCore/MessageService/test/UnitTestClient_C.cc b/FWCore/MessageService/test/UnitTestClient_C.cc index f405b68c78688..bc3f65d72decb 100644 --- a/FWCore/MessageService/test/UnitTestClient_C.cc +++ b/FWCore/MessageService/test/UnitTestClient_C.cc @@ -18,22 +18,22 @@ namespace edmtest { void UnitTestClient_C::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const { int i = 145; - edm::LogWarning("cat_A") << "Test of std::hex:" << i << std::hex << "in hex is" << i; - edm::LogWarning("cat_A") << "Test of std::setw(n) and std::setfill('c'):" - << "The following should read ++abcdefg $$$12:" << std::setfill('+') << std::setw(9) + edm::LogWarning("cat_A") << "Test of std::hex: " << i << std::hex << " in hex is " << i; + edm::LogWarning("cat_A") << "Test of std::setw(n) and std::setfill('c'): " + << "The following should read ++abcdefg $$$12: " << std::setfill('+') << std::setw(9) << "abcdefg" << std::setw(5) << std::setfill('$') << 12; double d = M_PI; - edm::LogWarning("cat_A") << "Test of std::setprecision(p):" - << "Pi with precision 12 is" << std::setprecision(12) << d; - edm::LogWarning("cat_A") << "Test of spacing:" - << "The following should read a b c dd:" + edm::LogWarning("cat_A") << "Test of std::setprecision(p): " + << "Pi with precision 12 is " << std::setprecision(12) << d; + edm::LogWarning("cat_A") << "Test of spacing: " + << "The following should read a b c dd: " << "a" << std::setfill('+') << "b" << std::hex << "c" << std::setw(2) << "dd"; edm::LogWarning("cat_A").format("Test of format hex: {0} in hex is {0:x}", i); edm::LogWarning("cat_A") - .format("Test of format fill and width:") + .format("Test of format fill and width: ") .format("The following should read ++abcdefg $$$12: {:+>9} {:$>5}", "abcdefg", 12); - edm::LogWarning("cat_A").format("Test of format precision:Pi with precision 12 is {:.12g}", d); + edm::LogWarning("cat_A").format("Test of format precision: Pi with precision 12 is {:.12g}", d); edm::LogWarning("cat_A").format( "Test of format spacing: The following should read a b cc: {} {:+>} {:>2}", "a", "b", "cc"); } diff --git a/FWCore/MessageService/test/unit_test_outputs/u10_warnings.log b/FWCore/MessageService/test/unit_test_outputs/u10_warnings.log index ffd51189ddeaa..2a78eb3743e28 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u10_warnings.log +++ b/FWCore/MessageService/test/unit_test_outputs/u10_warnings.log @@ -1,23 +1,23 @@ %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::hex:145in hex is91 +Test of std::hex: 145 in hex is 91 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::setw(n) and std::setfill('c'):The following should read ++abcdefg $$$12:++abcdefg$$$12 +Test of std::setw(n) and std::setfill('c'): The following should read ++abcdefg $$$12: ++abcdefg$$$12 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::setprecision(p):Pi with precision 12 is3.14159265359 +Test of std::setprecision(p): Pi with precision 12 is 3.14159265359 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of spacing:The following should read a b c dd:abcdd +Test of spacing: The following should read a b c dd: abcdd %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 Test of format hex: 145 in hex is 91 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of format fill and width:The following should read ++abcdefg $$$12: ++abcdefg $$$12 +Test of format fill and width: The following should read ++abcdefg $$$12: ++abcdefg $$$12 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of format precision:Pi with precision 12 is 3.14159265359 +Test of format precision: Pi with precision 12 is 3.14159265359 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 Test of format spacing: The following should read a b cc: a b cc diff --git a/FWCore/MessageService/test/unit_test_outputs/u6_warnings.log b/FWCore/MessageService/test/unit_test_outputs/u6_warnings.log index ffd51189ddeaa..2a78eb3743e28 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u6_warnings.log +++ b/FWCore/MessageService/test/unit_test_outputs/u6_warnings.log @@ -1,23 +1,23 @@ %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::hex:145in hex is91 +Test of std::hex: 145 in hex is 91 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::setw(n) and std::setfill('c'):The following should read ++abcdefg $$$12:++abcdefg$$$12 +Test of std::setw(n) and std::setfill('c'): The following should read ++abcdefg $$$12: ++abcdefg$$$12 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of std::setprecision(p):Pi with precision 12 is3.14159265359 +Test of std::setprecision(p): Pi with precision 12 is 3.14159265359 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of spacing:The following should read a b c dd:abcdd +Test of spacing: The following should read a b c dd: abcdd %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 Test of format hex: 145 in hex is 91 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of format fill and width:The following should read ++abcdefg $$$12: ++abcdefg $$$12 +Test of format fill and width: The following should read ++abcdefg $$$12: ++abcdefg $$$12 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 -Test of format precision:Pi with precision 12 is 3.14159265359 +Test of format precision: Pi with precision 12 is 3.14159265359 %MSG %MSG-w cat_A: UnitTestClient_C:sendSomeMessages Run: 1 Event: 1 Test of format spacing: The following should read a b cc: a b cc