Chrysalis - CLO3D DevTools Extension Test Coverage


integrations/clo3d/extensions/dev-tools/
File: integrations/clo3d/extensions/dev-tools/src/LoggerRegistryModel.cpp
Date: 2026-08-27 18:36:32
Lines:
0/17
0.0%
Functions:
0/6
0.0%
Branches:
0/14
0.0%
Decisions:
0/6
0.0%
Calls:
0/47
0.0%

Line Branch Decision Call Exec Source
1 #include "LoggerRegistryModel.h"
2
3 #include "LoggerRegistry.h"
4
5 using namespace CLO3D::UI;
6
7
0/1
✗ Call 0 not invoked.
✗ LoggerRegistryModel::LoggerRegistryModel(QObject* parent, Logging::LoggerRegistry& registry)
8
0/9
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ : QAbstractTableModel(parent), registry_(registry) {}
9
10 ✗ Qt::ItemFlags LoggerRegistryModel::flags(const QModelIndex& index) const {
11
0/8
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ auto flags = QAbstractTableModel::flags(index);
12
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/3
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 4 not invoked.
✗ if (index.column() == 1) flags |= Qt::ItemIsEditable;
13
0/1
✗ Call 0 not invoked.
✗ return flags;
14 }
15
16 ✗ int LoggerRegistryModel::rowCount(const QModelIndex& parent) const {
17
0/6
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ return static_cast<int>(registry_.size());
18 }
19
20 ✗ int LoggerRegistryModel::columnCount(const QModelIndex& parent) const {
21 ✗ return 2;
22 }
23
24 ✗ QVariant LoggerRegistryModel::data(const QModelIndex& index, const int role) const {
25
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/1
✗ Call 2 not invoked.
✗ if (role != Qt::DisplayRole) return {};
26
0/8
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 2 not invoked.
✗ Call 3 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ const auto logger = registry_.at(index.row());
27
0/8
✗ Call 0 not invoked.
✗ Call 1 not invoked.
✗ Call 4 not invoked.
✗ Call 5 not invoked.
✗ Call 6 not invoked.
✗ Call 7 not invoked.
✗ Call 8 not invoked.
✗ Call 9 not invoked.
✗ return index.column() == 0 ? QVariant(logger->getName()) : static_cast<int>(logger->getLevel());
28 }
29
30 ✗ QVariant LoggerRegistryModel::headerData(const int section, const Qt::Orientation orientation, const int role) const {
31 constexpr static auto NAME_COLUMN = "Name";
32 constexpr static auto LEVEL_COLUMN = "Level";
33
0/2
✗ Decision 'true' not taken.
✗ Decision 'false' not taken.
0/1
✗ Call 4 not invoked.
✗ if (role != Qt::DisplayRole || orientation != Qt::Horizontal) return {};
34
0/1
✗ Call 2 not invoked.
✗ return section == 0 ? NAME_COLUMN : LEVEL_COLUMN;
35 }
36