summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ProfileData/CoverageMappingTest.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-10-19 06:16:23 +0000
committerVedant Kumar <vsk@apple.com>2017-10-19 06:16:23 +0000
commitf5f153dd6f1944c4bcca4a1485df3098eef13096 (patch)
treeae7e6567d845e8690c699f012b5e7d1c5e70b6cb /llvm/unittests/ProfileData/CoverageMappingTest.cpp
parent3612d4b4f9df25d11b8ab64109ea5450eef2439a (diff)
downloadbcm5719-llvm-f5f153dd6f1944c4bcca4a1485df3098eef13096.tar.gz
bcm5719-llvm-f5f153dd6f1944c4bcca4a1485df3098eef13096.zip
[Coverage] Simplify r316141. NFC.
llvm-svn: 316147
Diffstat (limited to 'llvm/unittests/ProfileData/CoverageMappingTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/CoverageMappingTest.cpp47
1 files changed, 6 insertions, 41 deletions
diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
index ad0a0cfb873..ce52c6f93ee 100644
--- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp
+++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
@@ -647,49 +647,14 @@ TEST_P(CoverageMappingTest, test_line_coverage_iterator) {
CoverageData Data = LoadedCoverage->getCoverageForFile("file1");
- unsigned NumLineStats = 0;
+ unsigned Line = 0;
+ unsigned LineCounts[] = {20, 20, 20, 20, 10, 10, 10, 10, 10, 0, 0};
for (const auto &LCS : getLineCoverageStats(Data)) {
- ++NumLineStats;
- (void)LCS;
+ ASSERT_EQ(Line + 1, LCS.getLine());
+ ASSERT_EQ(LineCounts[Line], LCS.getExecutionCount());
+ ++Line;
}
- ASSERT_EQ(11U, NumLineStats);
-
- LineCoverageIterator LCI{Data};
-
- ASSERT_EQ(1U, LCI->getLine());
- ASSERT_EQ(20ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(2U, LCI->getLine());
- ASSERT_EQ(20ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(3U, LCI->getLine());
- ASSERT_EQ(20ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(4U, LCI->getLine());
- ASSERT_EQ(20ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(5U, LCI->getLine());
- ASSERT_EQ(10ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(6U, LCI->getLine());
- ASSERT_EQ(10ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(7U, LCI->getLine());
- ASSERT_EQ(10ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(8U, LCI->getLine());
- ASSERT_EQ(10ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(9U, LCI->getLine());
- ASSERT_EQ(10ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(10U, LCI->getLine());
- ASSERT_EQ(0ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(11U, LCI->getLine());
- ASSERT_EQ(0ULL, LCI->getExecutionCount());
- ++LCI;
- ASSERT_EQ(LCI, LCI.getEnd());
+ ASSERT_EQ(11U, Line);
}
TEST_P(CoverageMappingTest, uncovered_function) {
OpenPOWER on IntegriCloud