llgs-tests: Replace the "log+return false" pattern with llvm::Error
authorPavel Labath <labath@google.com>
Thu, 9 Nov 2017 15:45:09 +0000 (15:45 +0000)
committerPavel Labath <labath@google.com>
Thu, 9 Nov 2017 15:45:09 +0000 (15:45 +0000)
commit1ebc85f86fd423db1366ba30ec029f19182bd4ea
tree1908bcfd0a09b648255cdad7724072865be15e48
parent818da9bb299cad1a75e5e31dbd96dabb22f54cb8
llgs-tests: Replace the "log+return false" pattern with llvm::Error

Summary:
These tests used to log the error message and return plain bool mainly
because at the time they we written, we did not have a nice way to
assert on llvm::Error values. That is no longer true, so replace this
pattern with a more idiomatic approach.

As a part of this patch, I also move the formatting of
GDBRemoteCommunication::PacketResult values out of the test code, as
that can be useful elsewhere.

Reviewers: zturner, eugene

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D39790

llvm-svn: 317795
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/unittests/tools/lldb-server/tests/CMakeLists.txt
lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
lldb/unittests/tools/lldb-server/tests/MessageObjects.h
lldb/unittests/tools/lldb-server/tests/TestClient.cpp
lldb/unittests/tools/lldb-server/tests/TestClient.h
lldb/unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp