Author: mgorny Date: Tue Feb 26 12:14:07 2019 New Revision: 354922 URL: http://llvm.org/viewvc/llvm-project?rev=354922&view=rev Log: [lldb] [unittests] Use non-empty format string for Timer()
Pass dummy '.' as format string for Timer() rather than an empty string, in order to silence gcc warnings about empty format string (-Wformat-zero-length). The actual format string is irrelevant to the test in question. Differential Revision: https://reviews.llvm.org/D58680 Modified: lldb/trunk/unittests/Utility/TimerTest.cpp Modified: lldb/trunk/unittests/Utility/TimerTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/TimerTest.cpp?rev=354922&r1=354921&r2=354922&view=diff ============================================================================== --- lldb/trunk/unittests/Utility/TimerTest.cpp (original) +++ lldb/trunk/unittests/Utility/TimerTest.cpp Tue Feb 26 12:14:07 2019 @@ -17,7 +17,7 @@ TEST(TimerTest, CategoryTimes) { Timer::ResetCategoryTimes(); { static Timer::Category tcat("CAT1"); - Timer t(tcat, ""); + Timer t(tcat, "."); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } StreamString ss; @@ -32,10 +32,10 @@ TEST(TimerTest, CategoryTimesNested) { Timer::ResetCategoryTimes(); { static Timer::Category tcat1("CAT1"); - Timer t1(tcat1, ""); + Timer t1(tcat1, "."); std::this_thread::sleep_for(std::chrono::milliseconds(10)); // Explicitly testing the same category as above. - Timer t2(tcat1, ""); + Timer t2(tcat1, "."); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } StreamString ss; @@ -52,10 +52,10 @@ TEST(TimerTest, CategoryTimes2) { Timer::ResetCategoryTimes(); { static Timer::Category tcat1("CAT1"); - Timer t1(tcat1, ""); + Timer t1(tcat1, "."); std::this_thread::sleep_for(std::chrono::milliseconds(100)); static Timer::Category tcat2("CAT2"); - Timer t2(tcat2, ""); + Timer t2(tcat2, "."); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } StreamString ss; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits