This revision was automatically updated to reflect the committed changes.
Closed by commit rG206e8d890503: Fix SBError::SetErrorToGenericError (authored 
by werat, committed by teemperor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90151/new/

https://reviews.llvm.org/D90151

Files:
  lldb/source/API/SBError.cpp
  lldb/test/API/python_api/sberror/TestSBError.py


Index: lldb/test/API/python_api/sberror/TestSBError.py
===================================================================
--- /dev/null
+++ lldb/test/API/python_api/sberror/TestSBError.py
@@ -0,0 +1,13 @@
+"""Test the SBError APIs."""
+
+from lldbsuite.test.lldbtest import *
+
+class TestSBError(TestBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    def test_generic_error(self):
+        error = lldb.SBError()
+        error.SetErrorToGenericError()
+        self.assertEqual(error.GetType(), lldb.eErrorTypeGeneric)
Index: lldb/source/API/SBError.cpp
===================================================================
--- lldb/source/API/SBError.cpp
+++ lldb/source/API/SBError.cpp
@@ -118,7 +118,7 @@
   LLDB_RECORD_METHOD_NO_ARGS(void, SBError, SetErrorToGenericError);
 
   CreateIfNeeded();
-  m_opaque_up->SetErrorToErrno();
+  m_opaque_up->SetErrorToGenericError();
 }
 
 void SBError::SetErrorString(const char *err_str) {


Index: lldb/test/API/python_api/sberror/TestSBError.py
===================================================================
--- /dev/null
+++ lldb/test/API/python_api/sberror/TestSBError.py
@@ -0,0 +1,13 @@
+"""Test the SBError APIs."""
+
+from lldbsuite.test.lldbtest import *
+
+class TestSBError(TestBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+    NO_DEBUG_INFO_TESTCASE = True
+
+    def test_generic_error(self):
+        error = lldb.SBError()
+        error.SetErrorToGenericError()
+        self.assertEqual(error.GetType(), lldb.eErrorTypeGeneric)
Index: lldb/source/API/SBError.cpp
===================================================================
--- lldb/source/API/SBError.cpp
+++ lldb/source/API/SBError.cpp
@@ -118,7 +118,7 @@
   LLDB_RECORD_METHOD_NO_ARGS(void, SBError, SetErrorToGenericError);
 
   CreateIfNeeded();
-  m_opaque_up->SetErrorToErrno();
+  m_opaque_up->SetErrorToGenericError();
 }
 
 void SBError::SetErrorString(const char *err_str) {
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to