[clangd][test] Fix error message in SerializationTest.BinaryConversions
authorTom Praschan <13141438+tom-anders@users.noreply.github.com>
Thu, 11 Aug 2022 06:32:22 +0000 (08:32 +0200)
committerTom Praschan <13141438+tom-anders@users.noreply.github.com>
Thu, 11 Aug 2022 06:50:23 +0000 (08:50 +0200)
I noticed this when adding a new type to the index for
https://github.com/clangd/clangd/issues/529. When the assertion failed,
this actually caused a crash, because llvm::expected would complain that
we did not take the error.

clang-tools-extra/clangd/unittests/SerializationTests.cpp

index e99626b..ae1914f 100644 (file)
@@ -222,7 +222,7 @@ TEST(SerializationTest, BinaryConversions) {
   std::string Serialized = llvm::to_string(Out);
 
   auto In2 = readIndexFile(Serialized);
-  ASSERT_TRUE(bool(In2)) << In.takeError();
+  ASSERT_TRUE(bool(In2)) << In2.takeError();
   ASSERT_TRUE(In2->Symbols);
   ASSERT_TRUE(In2->Refs);
   ASSERT_TRUE(In2->Relations);