summaryrefslogtreecommitdiff
path: root/lldb/unittests
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2023-03-08 22:21:00 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2023-03-08 22:21:00 -0800
commitf009241ae595ae6db5a859e498f72fd7e5dc6ce8 (patch)
tree8a1ce88d397bf118cb883a7271d991c5be0525cd /lldb/unittests
parent73058e330134d275070d49dba80e5fda50ec015b (diff)
downloadllvm-f009241ae595ae6db5a859e498f72fd7e5dc6ce8.tar.gz
[lldb] Fix -Wdangling-else warning in CommunicationTest
Fixed warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
Diffstat (limited to 'lldb/unittests')
-rw-r--r--lldb/unittests/Core/CommunicationTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/unittests/Core/CommunicationTest.cpp b/lldb/unittests/Core/CommunicationTest.cpp
index 19ca4cb3d249..df9ff089a0d7 100644
--- a/lldb/unittests/Core/CommunicationTest.cpp
+++ b/lldb/unittests/Core/CommunicationTest.cpp
@@ -86,8 +86,9 @@ static void CommunicationReadTest(bool use_read_thread) {
// Test using Communication that is disconnected.
ASSERT_EQ(comm.Disconnect(), lldb::eConnectionStatusSuccess);
- if (use_read_thread)
+ if (use_read_thread) {
ASSERT_TRUE(comm.StartReadThread());
+ }
error.Clear();
EXPECT_EQ(
comm.Read(buf, sizeof(buf), std::chrono::seconds(5), status, &error), 0U);
@@ -97,8 +98,9 @@ static void CommunicationReadTest(bool use_read_thread) {
// Test using Communication without a connection.
comm.SetConnection(nullptr);
- if (use_read_thread)
+ if (use_read_thread) {
ASSERT_TRUE(comm.StartReadThread());
+ }
error.Clear();
EXPECT_EQ(
comm.Read(buf, sizeof(buf), std::chrono::seconds(5), status, &error), 0U);