[clang-tools-extra] r324736 - [clangd] Fix crash in tests in debug mode.

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 9 07:11:07 PST 2018


Author: ibiryukov
Date: Fri Feb  9 07:11:07 2018
New Revision: 324736

URL: http://llvm.org/viewvc/llvm-project?rev=324736&view=rev
Log:
[clangd] Fix crash in tests in debug mode.

Caused by the lack of checking of an Expected value in the previous
commit.

Modified:
    clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp

Modified: clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp?rev=324736&r1=324735&r2=324736&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp Fri Feb  9 07:11:07 2018
@@ -483,9 +483,9 @@ TEST_F(ClangdVFSTest, InvalidCompileComm
           .get()
           .Value.items,
       IsEmpty());
-  EXPECT_THAT(
-      Server.signatureHelp(FooCpp, Position{0, 0}).get().Value.signatures,
-      IsEmpty());
+  auto SigHelp = Server.signatureHelp(FooCpp, Position{0, 0});
+  ASSERT_TRUE(bool(SigHelp)) << "signatureHelp returned an error";
+  EXPECT_THAT(SigHelp->Value.signatures, IsEmpty());
 }
 
 class ClangdThreadingTest : public ClangdVFSTest {};




More information about the cfe-commits mailing list