[Lldb-commits] [lldb] r354922 - [lldb] [unittests] Use non-empty format string for Timer()

Michal Gorny via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 26 12:14:07 PST 2019


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;




More information about the lldb-commits mailing list