[PATCH] D51111: Add more pre-run asserts for the DirCompletionAbsolute test

Raphael Isemann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 23 16:22:56 PDT 2018


This revision was automatically updated to reflect the committed changes.
teemperor marked an inline comment as done.
Closed by commit rL340589: Add more pre-run asserts for the DirCompletionAbsolute test (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D51111?vs=162295&id=162298#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D51111

Files:
  lldb/trunk/unittests/Interpreter/TestCompletion.cpp


Index: lldb/trunk/unittests/Interpreter/TestCompletion.cpp
===================================================================
--- lldb/trunk/unittests/Interpreter/TestCompletion.cpp
+++ lldb/trunk/unittests/Interpreter/TestCompletion.cpp
@@ -163,6 +163,9 @@
 
   // When a directory is specified that doesn't end in a slash, it searches
   // for that directory, not items under it.
+  // Sanity check that the path we complete on exists and isn't too long.
+  ASSERT_TRUE(llvm::sys::fs::exists(BaseDir));
+  ASSERT_LE(BaseDir.size(), static_cast<size_t>(PATH_MAX));
   size_t Count =
       CommandCompletions::DiskDirectories(BaseDir, Results, Resolver);
   ASSERT_EQ(1u, Count);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51111.162298.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180823/e7579a51/attachment.bin>


More information about the llvm-commits mailing list