MailJDTourDownloadDocsQualityTestsCoverage

Which source lines and branches the tests execute. Lines 91.5 %, branches 75.0 % (minimum 85 % and 72 %). main @ 399ffe3d · 21 October 2026 · pipeline 7238.

GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 6 / 0 / 6
Functions: 100.0% 1 / 0 / 1
Branches: 100.0% 10 / 0 / 10

util/PdfAdmission.h
Line Branch Exec Source
1 #pragma once
2 #include <QFile>
3
4 namespace PdfAdmission {
5 inline constexpr qint64 maximumBytes = 64 * 1024 * 1024;
6 enum class Result { Accepted, TooLarge, NotPdf, Unreadable };
7
8 10 inline Result checkFile(const QString &path) {
9
1/1
✓ Branch 2 → 3 taken 10 times.
10 QFile file(path);
10
3/3
✓ Branch 4 → 5 taken 10 times.
✓ Branch 5 → 6 taken 1 time.
✓ Branch 5 → 7 taken 9 times.
10 if (!file.open(QIODevice::ReadOnly)) return Result::Unreadable;
11
3/3
✓ Branch 7 → 8 taken 9 times.
✓ Branch 8 → 9 taken 1 time.
✓ Branch 8 → 10 taken 8 times.
9 if (file.size() > maximumBytes) return Result::TooLarge;
12 // Qt PDF accepts headers after a short binary preamble. Read only this prefix.
13
3/3
✓ Branch 10 → 11 taken 8 times.
✓ Branch 13 → 14 taken 4 times.
✓ Branch 13 → 15 taken 4 times.
8 return file.read(1024).contains("%PDF-") ? Result::Accepted : Result::NotPdf;
14 10 }
15 } // namespace PdfAdmission
16