[Lldb-commits] [PATCH] D67996: Convert FileSystem::Open() to return Expected<FileUP>

Lawrence D'Anna via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 25 15:01:16 PDT 2019


lawrence_danna marked 19 inline comments as done.
lawrence_danna added a comment.

wow, I didn't realize the part about actually consuming the error.   I thought the asserts only checked that you checked if there was an error.   Uploading fixes momentarily



================
Comment at: lldb/unittests/Host/FileSystemTest.cpp:292-322
+TEST(FileSystemTest, OpenErrno) {
+#ifdef _WIN32
+  FileSpec spec("C:\\FILE\\THAT\\DOES\\NOT\\EXIST.TXT");
+#else
+  FileSpec spec("/file/that/does/not/exist.txt");
+#endif
+  FileSystem fs;
----------------
labath wrote:
> What's the point of having both of these tests? The error code should be the same no matter how you retrieve it from the expected object, so this is more of a unit test for the Expected class, than anything else...
GDBRemoteCommunicationServerCommon.cpp collects and errno value and sends it over the network.   I wanted to confirm FileSystem::Open() was returning and Error value that could be correctly converted into errno.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67996/new/

https://reviews.llvm.org/D67996





More information about the lldb-commits mailing list