[Lldb-commits] [lldb] r295436 - Fix breakage caused by r295368

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 17 02:19:47 PST 2017


Author: labath
Date: Fri Feb 17 04:19:46 2017
New Revision: 295436

URL: http://llvm.org/viewvc/llvm-project?rev=295436&view=rev
Log:
Fix breakage caused by r295368

Also move the ErrorTest into the Utility package, to follow the class it
is testing.

Added:
    lldb/trunk/unittests/Utility/ErrorTest.cpp
      - copied, changed from r295400, lldb/trunk/unittests/Core/ErrorTest.cpp
Removed:
    lldb/trunk/unittests/Core/ErrorTest.cpp
Modified:
    lldb/trunk/source/Utility/Error.cpp
    lldb/trunk/unittests/Core/CMakeLists.txt
    lldb/trunk/unittests/Utility/CMakeLists.txt

Modified: lldb/trunk/source/Utility/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/Error.cpp?rev=295436&r1=295435&r2=295436&view=diff
==============================================================================
--- lldb/trunk/source/Utility/Error.cpp (original)
+++ lldb/trunk/source/Utility/Error.cpp Fri Feb 17 04:19:46 2017
@@ -235,6 +235,7 @@ int Error::SetErrorStringWithVarArg(cons
 
     llvm::SmallString<1024> buf;
     VASprintf(buf, format, args);
+    m_string = buf.str();
     return buf.size();
   } else {
     m_string.clear();

Modified: lldb/trunk/unittests/Core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/CMakeLists.txt?rev=295436&r1=295435&r2=295436&view=diff
==============================================================================
--- lldb/trunk/unittests/Core/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Core/CMakeLists.txt Fri Feb 17 04:19:46 2017
@@ -2,7 +2,6 @@ add_lldb_unittest(LLDBCoreTests
   ArchSpecTest.cpp
   BroadcasterTest.cpp
   DataExtractorTest.cpp
-  ErrorTest.cpp
   ListenerTest.cpp
   LogTest.cpp
   ScalarTest.cpp

Removed: lldb/trunk/unittests/Core/ErrorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/ErrorTest.cpp?rev=295435&view=auto
==============================================================================
--- lldb/trunk/unittests/Core/ErrorTest.cpp (original)
+++ lldb/trunk/unittests/Core/ErrorTest.cpp (removed)
@@ -1,19 +0,0 @@
-//===-- ErrorTest.cpp -------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/Utility/Error.h"
-#include "gtest/gtest.h"
-
-using namespace lldb_private;
-
-TEST(ErrorTest, Formatv) {
-  EXPECT_EQ("", llvm::formatv("{0}", Error()).str());
-  EXPECT_EQ("Hello Error", llvm::formatv("{0}", Error("Hello Error")).str());
-  EXPECT_EQ("Hello", llvm::formatv("{0:5}", Error("Hello Error")).str());
-}

Modified: lldb/trunk/unittests/Utility/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/CMakeLists.txt?rev=295436&r1=295435&r2=295436&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Utility/CMakeLists.txt Fri Feb 17 04:19:46 2017
@@ -1,5 +1,6 @@
 add_lldb_unittest(UtilityTests
   ConstStringTest.cpp
+  ErrorTest.cpp
   StringExtractorTest.cpp
   TaskPoolTest.cpp
   TimeoutTest.cpp
@@ -8,6 +9,6 @@ add_lldb_unittest(UtilityTests
 
   LINK_LIBS
       lldbUtility
-    LINK_COMPONENTS
-      Support
+  LINK_COMPONENTS
+    Support
   )

Copied: lldb/trunk/unittests/Utility/ErrorTest.cpp (from r295400, lldb/trunk/unittests/Core/ErrorTest.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ErrorTest.cpp?p2=lldb/trunk/unittests/Utility/ErrorTest.cpp&p1=lldb/trunk/unittests/Core/ErrorTest.cpp&r1=295400&r2=295436&rev=295436&view=diff
==============================================================================
    (empty)




More information about the lldb-commits mailing list