summaryrefslogtreecommitdiff
path: root/unittests/ProfileData/CoverageMappingTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:22:02 +0000
commit9df3605dea17e84f8183581f6103bd0c79e2a606 (patch)
tree70a2f36ce9eb9bb213603cd7f2f120af53fc176f /unittests/ProfileData/CoverageMappingTest.cpp
parent08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 (diff)
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 ea51f717a1db8..1d621f4060cad 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);
}