qi3pc(1.0.0-rc1) (Debug GNU 15.2.1)


./
File: tests/data/i3_messages.h
Date: 2025-12-19 02:36:39
Lines:
10 of 10, 0 excluded
100.0%
Functions:
2 of 2, 0 excluded
100.0%
Branches:
12 of 22, 0 excluded
54.5%

Line Branch Exec Source
1 /* \author Hantz Vius
2 *
3 * \copyright Copyright (C) 2019-2025 Hantz Vius
4 *
5 * \license{
6 * This file is part of qi3pc.
7 *
8 * qi3pc is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.}
20 */
21
22 #pragma once
23
24 #include <QJsonObject>
25
26 #include "workspaces.h"
27 #include "outputs.h"
28 #include "bindingModes.h"
29 #include "marks.h"
30 #include "tree.h"
31 #include "version.h"
32 #include "bindingState.h"
33 #include "barConfigs.h"
34 #include "config.h"
35 #include "command.h"
36
37 namespace test_qi3pc{
38 namespace data {
39 struct i3messages {
40 inline static auto workspaces = test_qi3pc::raw::data::workspaces;
41 inline static auto outputs = test_qi3pc::raw::data::outputs;
42 inline static auto bindingModes = test_qi3pc::raw::data::bindingModes;
43 inline static auto marks = test_qi3pc::raw::data::marks;
44 inline static auto tree = test_qi3pc::raw::data::tree;
45 inline static auto version = test_qi3pc::raw::data::version;
46 inline static auto bindingState = test_qi3pc::raw::data::bindingState;
47 inline static auto parsedBindingState = test_qi3pc::raw::data::parsedBindingState;
48 inline static auto barConfigs = test_qi3pc::raw::data::barConfigs;
49 inline static auto config = test_qi3pc::raw::data::config;
50
51 using Command = test_qi3pc::raw::data::Command;
52 inline static auto commands = test_qi3pc::raw::data::commands;
53
54 10 inline static QByteArray barIds() {
55
1/2
✓ Branch 2 → 3 taken 10 times.
✗ Branch 2 → 29 not taken.
10 auto begin = barConfigs.constBegin();
56
1/2
✓ Branch 3 → 4 taken 10 times.
✗ Branch 3 → 29 not taken.
10 auto end = barConfigs.constEnd();
57
1/2
✓ Branch 4 → 5 taken 10 times.
✗ Branch 4 → 29 not taken.
10 QJsonArray array;
58
2/2
✓ Branch 12 → 6 taken 10 times.
✓ Branch 12 → 13 taken 10 times.
20 for (auto it = begin; it != end; ++it) {
59
2/4
✓ Branch 7 → 8 taken 10 times.
✗ Branch 7 → 22 not taken.
✓ Branch 8 → 9 taken 10 times.
✗ Branch 8 → 20 not taken.
10 array.append(it.key());
60 }
61
62
2/4
✓ Branch 13 → 14 taken 10 times.
✗ Branch 13 → 26 not taken.
✓ Branch 14 → 15 taken 10 times.
✗ Branch 14 → 24 not taken.
20 return QJsonDocument(array).toJson(QJsonDocument::Compact);
63 10 }
64
65 5 inline static QJsonObject barConfig(const QString& id) {
66
3/6
✓ Branch 2 → 3 taken 5 times.
✗ Branch 2 → 11 not taken.
✓ Branch 3 → 4 taken 5 times.
✗ Branch 3 → 11 not taken.
✓ Branch 4 → 5 taken 5 times.
✗ Branch 4 → 9 not taken.
5 return QJsonDocument::fromJson(barConfigs[id]).object();
67 }
68 };
69 } // namespace data
70 } // namespace test_qi3pc
71