[llvm] [Minidump] Support multiple exceptions in a minidump (PR #107319)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 01:22:40 PDT 2024


================
@@ -751,8 +751,9 @@ TEST(MinidumpFile, getExceptionStream) {
   auto ExpectedFile = create(Data);
   ASSERT_THAT_EXPECTED(ExpectedFile, Succeeded());
   const MinidumpFile &File = **ExpectedFile;
-  Expected<const minidump::ExceptionStream &> ExpectedStream =
-      File.getExceptionStream();
+  auto ExceptionIterator = File.getExceptionStreams().begin();
+
+  Expected<const ExceptionStream &> ExpectedStream = *ExceptionIterator;
----------------
labath wrote:

```suggestion
  auto ExceptionStreams = File.getExceptionStreams();
  ASSERT_NE(ExceptionStreams.begin(), ExceptionStreams.end());
  ASSERT_EQ(std::next(ExceptionStreams.begin()), ExceptionStreams.end());

  Expected<const ExceptionStream &> ExpectedStream = *ExceptionStreams.begin();
```

.. or something along those lines, to check that the correct number of streams is returned.

Also, please rename the test to getExceptionStream**s**.

https://github.com/llvm/llvm-project/pull/107319


More information about the llvm-commits mailing list