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% 19 / 0 / 19
Functions: 100.0% 11 / 0 / 11
Branches: 71.7% 38 / 0 / 53

data/MailRequest.h
Line Branch Exec Source
1 #pragma once
2
3 #include <QByteArray>
4 #include <QMetaType>
5 #include <QString>
6
7 // Stable identity at controller, cache, and UI boundaries. An IMAP UID is
8 // scoped by both account and mailbox and must never cross these boundaries on
9 // its own.
10 struct MailId {
11 146105 QString accountId;
12 140129 qint64 folderId = -1;
13 139457 qint64 uid = -1;
14
15 209667 [[nodiscard]] bool isValid() const {
16
6/6
✓ Branch 3 → 4 taken 139474 times.
✓ Branch 3 → 7 taken 70193 times.
✓ Branch 4 → 5 taken 139470 times.
✓ Branch 4 → 7 taken 4 times.
✓ Branch 5 → 6 taken 139469 times.
✓ Branch 5 → 7 taken 1 time.
209667 return !accountId.isEmpty() && folderId > 0 && uid >= 0;
17 }
18 2 [[nodiscard]] bool hasFolderId() const { return folderId > 0; }
19
20
6/6
✓ Branch 3 → 4 taken 5976 times.
✓ Branch 3 → 5 taken 140129 times.
✓ Branch 5 → 6 taken 672 times.
✓ Branch 5 → 7 taken 139457 times.
✓ Branch 7 → 8 taken 18877 times.
✓ Branch 7 → 9 taken 120580 times.
146105 friend bool operator==(const MailId &, const MailId &) = default;
21 };
22
23 182492 inline size_t qHash(const MailId &id, size_t seed = 0) noexcept {
24 182492 seed = qHash(id.accountId, seed);
25 182492 seed = qHash(id.folderId, seed);
26 182492 return qHash(id.uid, seed);
27 }
28
29 enum class BodyPurpose {
30 Display,
31 Tab,
32 Prefetch,
33 Index,
34 };
35
36 enum class BodyOutcome {
37 Loaded,
38 TooLarge,
39 Cancelled,
40 Failed,
41 PreparationLimited,
42 };
43
44 // Controller-facing request. folderPath is included because the transport
45 // selects mailboxes by path while folderId remains owned by MailCache.
46 struct BodyRequest {
47 quint64 requestId = 0;
48 MailId mailId;
49 QString folderPath;
50 BodyPurpose purpose = BodyPurpose::Display;
51
52 5 [[nodiscard]] bool isValid() const {
53
6/6
✓ Branch 2 → 3 taken 4 times.
✓ Branch 2 → 8 taken 1 time.
✓ Branch 4 → 5 taken 3 times.
✓ Branch 4 → 8 taken 1 time.
✓ Branch 6 → 7 taken 2 times.
✓ Branch 6 → 8 taken 1 time.
5 return requestId > 0 && mailId.isValid() && !folderPath.isEmpty();
54 }
55 };
56
57 // Terminal transport result. The service echoes requestId, folderPath, and
58 // uid; it does not know or infer a cache folderId.
59 struct BodyResult {
60 quint64 requestId = 0;
61 QString folderPath;
62 qint64 uid = -1;
63 BodyOutcome outcome = BodyOutcome::Failed;
64 QByteArray bytes;
65 QString error;
66 qint64 maxBytes = 0;
67 // false: the connection failed before the FETCH was written (S92.5.2
68 // probe before use found a closed socket). Nothing reached the server, so
69 // the controller requeues the request instead of presenting a failure.
70 bool dispatched = true;
71
72 3 [[nodiscard]] bool isTerminal() const { return requestId > 0; }
73 };
74
75
4/7
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 8 times.
✓ Branch 8 → 9 taken 8 times.
✗ Branch 8 → 14 not taken.
✓ Branch 9 → 10 taken 8 times.
✓ Branch 10 → 11 taken 8 times.
✗ Branch 14 → 15 not taken.
8 Q_DECLARE_METATYPE(MailId)
76
4/7
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 1 time.
✓ Branch 8 → 9 taken 1 time.
✗ Branch 8 → 14 not taken.
✓ Branch 9 → 10 taken 1 time.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 14 → 15 not taken.
1 Q_DECLARE_METATYPE(BodyPurpose)
77
4/7
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 2 times.
✓ Branch 8 → 9 taken 2 times.
✗ Branch 8 → 14 not taken.
✓ Branch 9 → 10 taken 2 times.
✓ Branch 10 → 11 taken 2 times.
✗ Branch 14 → 15 not taken.
2 Q_DECLARE_METATYPE(BodyOutcome)
78
4/7
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 1 time.
✓ Branch 8 → 9 taken 1 time.
✗ Branch 8 → 14 not taken.
✓ Branch 9 → 10 taken 1 time.
✓ Branch 10 → 11 taken 1 time.
✗ Branch 14 → 15 not taken.
1 Q_DECLARE_METATYPE(BodyRequest)
79
4/7
✗ Branch 3 → 4 not taken.
✓ Branch 3 → 5 taken 4 times.
✓ Branch 8 → 9 taken 4 times.
✗ Branch 8 → 14 not taken.
✓ Branch 9 → 10 taken 4 times.
✓ Branch 10 → 11 taken 4 times.
✗ Branch 14 → 15 not taken.
4 Q_DECLARE_METATYPE(BodyResult)
80