aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-17 05:01:54 +0000
committerFangrui Song <i@maskray.me>2022-12-17 05:01:54 +0000
commit9464bd8c78d142225957abbf38ed3c2abaa9e180 (patch)
tree13c21a3054180b4b7c48f517f8c0ca132ba0416e /lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
parentf4b90773dc3d4773546a30a70c96deba3b858e5c (diff)
downloadllvm-9464bd8c78d142225957abbf38ed3c2abaa9e180.zip
llvm-9464bd8c78d142225957abbf38ed3c2abaa9e180.tar.gz
llvm-9464bd8c78d142225957abbf38ed3c2abaa9e180.tar.bz2
[lldb] llvm::Optional::value => operator*/operator->
std::optional::value() has undesired exception checking semantics and is unavailable in some older Xcode. The call sites block std::optional migration.
Diffstat (limited to 'lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index b396bdb..c570c08 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -192,12 +192,11 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
auto result = async_result.get();
ASSERT_TRUE(result.has_value());
ASSERT_EQ(1u, result->size());
- EXPECT_EQ("/foo/bar.so", result.value()[0].GetFileSpec().GetPath());
- EXPECT_EQ(triple, result.value()[0].GetArchitecture().GetTriple());
- EXPECT_EQ(UUID("@ABCDEFGHIJKLMNO", 16),
- result.value()[0].GetUUID());
- EXPECT_EQ(0u, result.value()[0].GetObjectOffset());
- EXPECT_EQ(1234u, result.value()[0].GetObjectSize());
+ EXPECT_EQ("/foo/bar.so", (*result)[0].GetFileSpec().GetPath());
+ EXPECT_EQ(triple, (*result)[0].GetArchitecture().GetTriple());
+ EXPECT_EQ(UUID("@ABCDEFGHIJKLMNO", 16), (*result)[0].GetUUID());
+ EXPECT_EQ(0u, (*result)[0].GetObjectOffset());
+ EXPECT_EQ(1234u, (*result)[0].GetObjectSize());
}
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
@@ -217,12 +216,11 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
auto result = async_result.get();
ASSERT_TRUE(result.has_value());
ASSERT_EQ(1u, result->size());
- EXPECT_EQ("/foo/bar.so", result.value()[0].GetFileSpec().GetPath());
- EXPECT_EQ(triple, result.value()[0].GetArchitecture().GetTriple());
- EXPECT_EQ(UUID("@ABCDEFGHIJKLMNOPQRS", 20),
- result.value()[0].GetUUID());
- EXPECT_EQ(0u, result.value()[0].GetObjectOffset());
- EXPECT_EQ(1234u, result.value()[0].GetObjectSize());
+ EXPECT_EQ("/foo/bar.so", (*result)[0].GetFileSpec().GetPath());
+ EXPECT_EQ(triple, (*result)[0].GetArchitecture().GetTriple());
+ EXPECT_EQ(UUID("@ABCDEFGHIJKLMNOPQRS", 20), (*result)[0].GetUUID());
+ EXPECT_EQ(0u, (*result)[0].GetObjectOffset());
+ EXPECT_EQ(1234u, (*result)[0].GetObjectSize());
}
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfoInvalidResponse) {