aboutsummaryrefslogtreecommitdiff
path: root/unittests/ProfileData/CoverageMappingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ProfileData/CoverageMappingTest.cpp')
-rw-r--r--unittests/ProfileData/CoverageMappingTest.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/unittests/ProfileData/CoverageMappingTest.cpp b/unittests/ProfileData/CoverageMappingTest.cpp
index ea51f717a1db..1d621f4060ca 100644
--- a/unittests/ProfileData/CoverageMappingTest.cpp
+++ b/unittests/ProfileData/CoverageMappingTest.cpp
@@ -232,15 +232,17 @@ struct CoverageMappingTest : ::testing::TestWithParam<std::pair<bool, bool>> {
}
Expected<std::unique_ptr<CoverageMapping>> readOutputFunctions() {
- if (!UseMultipleReaders) {
- CoverageMappingReaderMock CovReader(OutputFunctions);
- return CoverageMapping::load(CovReader, *ProfileReader);
- }
-
std::vector<std::unique_ptr<CoverageMappingReader>> CoverageReaders;
- for (const auto &OF : OutputFunctions) {
- ArrayRef<OutputFunctionCoverageData> Funcs(OF);
- CoverageReaders.push_back(make_unique<CoverageMappingReaderMock>(Funcs));
+ if (UseMultipleReaders) {
+ for (const auto &OF : OutputFunctions) {
+ ArrayRef<OutputFunctionCoverageData> Funcs(OF);
+ CoverageReaders.push_back(
+ make_unique<CoverageMappingReaderMock>(Funcs));
+ }
+ } else {
+ ArrayRef<OutputFunctionCoverageData> Funcs(OutputFunctions);
+ CoverageReaders.push_back(
+ make_unique<CoverageMappingReaderMock>(Funcs));
}
return CoverageMapping::load(CoverageReaders, *ProfileReader);
}