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

service/NativeDocumentCache.h
Line Branch Exec Source
1 #pragma once
2
3 #include "NativeMailDocument.h"
4 #include <QCache>
5 #include <optional>
6
7 // Owned exclusively by the native preparation worker. Images and external
8 // permissions are deliberately absent: each consumer must resolve them anew.
9 class NativeDocumentCache {
10 public:
11 static constexpr int RamBytes = 6 * 1024 * 1024;
12 static constexpr int DiskSlots = 64;
13 static constexpr qint64 MaxEntryBytes = 2 * 1024 * 1024;
14 explicit NativeDocumentCache(QString directory);
15 static QByteArray key(const QString &database, qint64 folder, qint64 uid,
16 quint32 uidValidity, const QByteArray &html);
17 static QByteArray keyWithDigest(const QString &database, qint64 folder, qint64 uid,
18 quint32 uidValidity, const QByteArray &htmlDigest);
19 std::optional<NativeMailDocument> get(const QByteArray &key);
20 void put(const QByteArray &key, const NativeMailDocument &document);
21 320 int ramBytes() const { return m_memory.totalCost(); }
22 private:
23 QString path(const QByteArray &key) const;
24 QString m_directory;
25 QCache<QByteArray, NativeMailDocument> m_memory{RamBytes};
26 };
27