aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-04 16:51:27 -0800
committerKazu Hirata <kazu@google.com>2022-12-04 16:51:27 -0800
commitd2a6114f27016065f6c7e7d39c0412e7d8d5e03b (patch)
treebc96197e8219779571e52ab1f0304954dd73fb36 /lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
parent343523d040d1ede65a35d8a6d514b0f7c198a3f2 (diff)
downloadllvm-d2a6114f27016065f6c7e7d39c0412e7d8d5e03b.zip
llvm-d2a6114f27016065f6c7e7d39c0412e7d8d5e03b.tar.gz
llvm-d2a6114f27016065f6c7e7d39c0412e7d8d5e03b.tar.bz2
[lldb/unittests] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp')
-rw-r--r--lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 80a9d98..b396bdb 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -458,14 +458,14 @@ TEST_F(GDBRemoteCommunicationClientTest, GetQOffsets) {
EXPECT_EQ((QOffsets{true, {0x1234, 0x2345}}),
GetQOffsets("TextSeg=1234;DataSeg=2345"));
- EXPECT_EQ(llvm::None, GetQOffsets("E05"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=bogus"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234;Data=1234;"));
- EXPECT_EQ(llvm::None, GetQOffsets("Text=1234;Data=1234;Bss=1234;"));
- EXPECT_EQ(llvm::None, GetQOffsets("TEXTSEG=1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234"));
- EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("E05"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=bogus"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234;Data=1234;"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("Text=1234;Data=1234;Bss=1234;"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TEXTSEG=1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TextSeg=0x1234"));
+ EXPECT_EQ(std::nullopt, GetQOffsets("TextSeg=12345678123456789"));
}
static void
@@ -522,26 +522,28 @@ TEST_F(GDBRemoteCommunicationClientTest, ReadMemoryTags) {
std::vector<uint8_t>{0x1, 0x2});
// Empty response is an error
- check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "", llvm::None);
+ check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "", std::nullopt);
// Usual error response
check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "E01",
- llvm::None);
+ std::nullopt);
// Leading m missing
- check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "01", llvm::None);
+ check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "01",
+ std::nullopt);
// Anything other than m is an error
check_qmemtags(client, server, 17, 1, "qMemTags:def0,11:1", "z01",
- llvm::None);
+ std::nullopt);
// Decoding tag data doesn't use all the chars in the packet
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m09zz",
- llvm::None);
+ std::nullopt);
// Data that is not hex bytes
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "mhello",
- llvm::None);
+ std::nullopt);
// Data is not a complete hex char
- check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m9", llvm::None);
+ check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m9",
+ std::nullopt);
// Data has a trailing hex char
check_qmemtags(client, server, 32, 1, "qMemTags:def0,20:1", "m01020",
- llvm::None);
+ std::nullopt);
}
static void check_Qmemtags(TestClient &client, MockServer &server,