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% 1 / 0 / 1
Functions: 100.0% 1 / 0 / 1
Branches: -% 0 / 0 / 0

data/PredictorTrainingReader.h
Line Branch Exec Source
1 #pragma once
2
3 #include <QList>
4 #include <QSqlDatabase>
5 #include <QString>
6
7 #include "data/Models.h"
8
9 // Bounded predictor-training reads over a MailCache connection (Sprint 91
10 // S91.1.4, extracted from MailCache). Callers reach it as
11 // `cache.training()`.
12 //
13 // Plain class, no connection of its own: it reads through the owning
14 // MailCache's QSqlDatabase and is used on whichever thread owns that cache
15 // instance (the predictor workers open their own read-only MailCache).
16 // It never writes and never starts a transaction.
17 class PredictorTrainingReader {
18 public:
19 5035 explicit PredictorTrainingReader(const QSqlDatabase &db) : m_db(db) {}
20
21 // Predictor input only: fixed 128-row UID page and 8 KiB per text field.
22 // An error never returns a partially usable page or advances the cursor.
23 struct TrainingSnapshot {
24 qint64 folderId = -1;
25 quint32 uidValidity = 0;
26 QString revision;
27 QString error;
28 };
29 TrainingSnapshot trainingSnapshot(const QString &account, const QString &folder) const;
30
31 struct TrainingPage {
32 QList<MailHeader> headers;
33 QString error;
34 quint32 uidValidity = 0;
35 qint64 folderId = -1;
36 };
37 TrainingPage trainingPage(const QString &account, const QString &folder,
38 qint64 afterUid = 0) const;
39 TrainingPage trainingHeaders(const QString &account, qint64 folderId,
40 const QString &folder, quint32 uidValidity,
41 const QList<qint64> &uids) const;
42 bool trainingIdentityCurrent(const QString &account, qint64 folderId,
43 const QString &folder, quint32 uidValidity) const;
44
45 private:
46 const QSqlDatabase &m_db; // owned by MailCache
47 };
48