Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSON
authorPavel Labath <labath@google.com>
Fri, 4 Nov 2016 11:49:06 +0000 (11:49 +0000)
committerPavel Labath <labath@google.com>
Fri, 4 Nov 2016 11:49:06 +0000 (11:49 +0000)
commit2fd9a1e0d9ee0a2a4458d7b6d55494a2a9c60038
tree1b30124545a3bfed5400aa7f074316de17c721be
parentbaeb40201476656d2478ae1af284cb8b17d1296c
Fix GDBRemoteCommunicationClientTest.TestPacketSpeedJSON

The mock server was listening for only one packet (I forgot to put a loop around
it), which caused the client to stall in debug builds, as the timeout there is
1000 seconds. In case of a release builds the test would just silently succeed as
the tested function does not check or report errors (which should be fixed).

This fixes the test by adding the server loop. Since the test was taking quite a
long time now (8s), I have added a parameter to control the amount of data sent
(default 4MB), and call it with a smaller value in the test, to make the test run
faster.

llvm-svn: 285992
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp