GCC Code Coverage Report


Directory: ./
File: autotests/wayland_backend.cpp
Date: 2023-04-20 22:59:23
Exec Total Coverage
Lines: 144 144 100.0%
Branches: 232 474 48.9%

Line Branch Exec Source
1 /*************************************************************************************
2 * Copyright 2014-2015 Sebastian K├╝gler <sebas@kde.org> *
3 * *
4 * This library is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * This library is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with this library; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
17 *************************************************************************************/
18 #include <QCoreApplication>
19 #include <QCryptographicHash>
20 #include <QObject>
21 #include <QtTest>
22
23 #include "backendmanager_p.h"
24 #include "config.h"
25 #include "configmonitor.h"
26 #include "getconfigoperation.h"
27 #include "mode.h"
28 #include "output.h"
29 #include "setconfigoperation.h"
30
31 #include "server.h"
32
33
3/8
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
1 Q_LOGGING_CATEGORY(DISMAN_WAYLAND, "disman.wayland")
34
35 using namespace Disman;
36
37 class wayland_backend : public QObject
38 {
39 Q_OBJECT
40
41 public:
42 explicit wayland_backend(QObject* parent = nullptr);
43
44 private Q_SLOTS:
45 void init();
46 void cleanup();
47 void loadConfig();
48
49 void verifyConfig();
50 void verifyScreen();
51 void verifyOutputs();
52 void verifyModes();
53 void verifyIds();
54 void verifyFeatures();
55 void simpleWrite();
56 void addAndRemoveOutput();
57
58 private:
59 ConfigPtr m_config;
60 server* m_server;
61 };
62
63 1 wayland_backend::wayland_backend(QObject* parent)
64 : QObject(parent)
65 1 , m_config(nullptr)
66 {
67
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 qputenv("DISMAN_IN_PROCESS", "1");
68
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 qputenv("DISMAN_LOGGING", "false");
69
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 QStandardPaths::setTestModeEnabled(true);
70
71
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 m_server = new server(this);
72
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
1 m_server->setConfig(QLatin1String(TEST_DATA) + QLatin1String("multipleoutput.json"));
73 1 }
74
75 9 void wayland_backend::init()
76 {
77
1/2
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
9 qputenv("DISMAN_BACKEND", "wayland");
78
79 // This is how Wrapland will pick up the right socket,
80 // and thus connect to our internal test server.
81 9 setenv("WAYLAND_DISPLAY", s_socketName, 1);
82 9 m_server->start();
83
84
1/4
✓ Branch 2 taken 9 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
9 GetConfigOperation* op = new GetConfigOperation();
85 9 op->exec();
86
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 m_config = op->config();
87
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
9 QVERIFY(m_config);
88 }
89
90 9 void wayland_backend::cleanup()
91 {
92
2/4
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
9 Disman::BackendManager::instance()->shutdown_backend();
93
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 m_server->stop();
94
95 // Make sure we did not accidentally unset test mode prior and delete our user configuration.
96
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 QStandardPaths::setTestModeEnabled(true);
97
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
18 QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
98
1/2
✓ Branch 3 taken 9 times.
✗ Branch 4 not taken.
27 % QStringLiteral("/disman/");
99
4/8
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 9 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 9 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 9 times.
9 QVERIFY(QDir(path).removeRecursively());
100
1/2
✓ Branch 1 taken 9 times.
✗ Branch 2 not taken.
9 }
101
102 1 void wayland_backend::loadConfig()
103 {
104
1/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
1 GetConfigOperation* op = new GetConfigOperation();
105 1 op->exec();
106
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 m_config = op->config();
107
1/2
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
1 QVERIFY(m_config->valid());
108
7/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 1 times.
2 qCDebug(DISMAN_WAYLAND) << "Outputs:" << m_config->outputs();
109 }
110
111 1 void wayland_backend::verifyConfig()
112 {
113
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
1 QVERIFY(m_config != nullptr);
114 }
115
116 1 void wayland_backend::verifyScreen()
117 {
118
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 ScreenPtr screen = m_config->screen();
119
120
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->min_size().width() <= screen->max_size().width());
121
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->min_size().height() <= screen->max_size().height());
122
123
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->min_size().width() <= screen->current_size().width());
124
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->min_size().height() <= screen->current_size().height());
125
126
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->max_size().width() >= screen->current_size().width());
127
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QVERIFY(screen->max_size().height() >= screen->current_size().height());
128
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
1 QVERIFY(m_config->screen()->max_outputs_count() > 0);
129
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
130
131 1 void wayland_backend::verifyOutputs()
132 {
133
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
1 QVERIFY(!m_config->primary_output());
134
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
1 QVERIFY(m_config->outputs().size());
135
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 times.
1 QCOMPARE(m_server->outputs.size(), m_config->outputs().size());
136
137 1 QList<int> ids;
138
3/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 1 times.
3 for (auto const& [key, output] : m_config->outputs()) {
139
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
2 QVERIFY(output->name().size());
140
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
2 QVERIFY(output->id() > -1);
141
3/6
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
2 QVERIFY(output->geometry() != QRectF(1, 1, 1, 1));
142
3/6
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
2 QVERIFY(output->geometry() != QRectF());
143
3/6
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
2 QVERIFY(output->physical_size() != QSize());
144
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
2 QVERIFY(output->preferred_modes().size() == 1);
145
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
2 QCOMPARE(output->rotation(), Output::None);
146
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
2 QVERIFY(!ids.contains(output->id()));
147
2/4
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
2 ids << output->id();
148
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
149
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
150
151 1 void wayland_backend::verifyModes()
152 {
153
3/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 1 times.
3 for (auto const& [key, output] : m_config->outputs()) {
154
3/4
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 11 taken 7 times.
✓ Branch 12 taken 2 times.
9 for (auto const& [key, mode] : output->modes()) {
155
3/6
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 7 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 7 times.
7 QVERIFY(!mode->name().empty());
156
3/6
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 7 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 7 times.
7 QVERIFY(mode->refresh() > 0);
157
3/6
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 7 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 7 times.
7 QVERIFY(mode->size().isValid());
158
1/2
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
2 }
159
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
160 }
161
162 1 void wayland_backend::verifyIds()
163 {
164 1 QList<quint32> ids;
165
3/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 1 times.
3 for (auto const& [key, output] : m_config->outputs()) {
166
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
2 QVERIFY(ids.contains(output->id()) == false);
167
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
2 QVERIFY(output->id() > 0);
168
2/4
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
2 ids << output->id();
169
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
170
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
171
172 1 void wayland_backend::simpleWrite()
173 {
174
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 Disman::BackendManager::instance()->shutdown_backend();
175
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 GetConfigOperation* op = new GetConfigOperation();
176
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 op->exec();
177
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 m_config = op->config();
178
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 auto output = m_config->output(2);
179
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
1 QVERIFY(output);
180
2/4
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
1 auto mode = output->mode("4");
181
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
1 QVERIFY(mode);
182
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 output->set_mode(mode);
183
4/8
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
1 QCOMPARE(output->commanded_mode()->size(), QSize(800, 600));
184
185
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 auto setop = new SetConfigOperation(m_config);
186
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
1 QVERIFY(setop->exec());
187
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 }
188
189 1 void wayland_backend::addAndRemoveOutput()
190 {
191
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 Disman::BackendManager::instance()->shutdown_backend();
192
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 GetConfigOperation* op = new GetConfigOperation();
193
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 op->exec();
194
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 auto config = op->config();
195
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
1 QCOMPARE(config->outputs().size(), 2);
196
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 Disman::ConfigMonitor* monitor = Disman::ConfigMonitor::instance();
197
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 monitor->add_config(config);
198
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 QSignalSpy configSpy(monitor, &Disman::ConfigMonitor::configuration_changed);
199
200 // Now add an outputdevice on the server side
201
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 Wrapland::Server::output_metadata output_meta;
202
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 output_meta.name = "1337";
203
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 m_server->outputs.emplace_back(
204
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 std::make_unique<Wrapland::Server::output>(output_meta, *m_server->output_manager));
205
206 1 Wrapland::Server::output_mode m0;
207 1 m0.id = 0;
208 1 m0.size = QSize(800, 600);
209 1 m0.preferred = true;
210
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 m_server->outputs.back()->add_mode(m0);
211
212 1 Wrapland::Server::output_mode m2;
213 1 m2.id = 2;
214 1 m2.size = QSize(1280, 1024);
215 1 m2.refresh_rate = 90000;
216
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 m_server->outputs.back()->add_mode(m2);
217
218 1 Wrapland::Server::output_mode m1;
219 1 m1.id = 1;
220 1 m1.size = QSize(1024, 768);
221
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 m_server->outputs.back()->add_mode(m1);
222
223
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 auto state = m_server->outputs.back()->get_state();
224 1 state.geometry = {QPoint(), m1.size};
225
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
1 m_server->outputs.back()->set_state(state);
226
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 m_server->output_manager->commit_changes();
227
228
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
1 QVERIFY(configSpy.wait());
229 // QTRY_VERIFY(configSpy.count());
230
231
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 GetConfigOperation* op2 = new GetConfigOperation();
232
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 op2->exec();
233
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 auto newconfig = op2->config();
234
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
1 QCOMPARE(newconfig->outputs().size(), 3);
235
236 // Now remove the output again.
237 1 m_server->outputs.pop_back();
238
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 m_server->output_manager->commit_changes();
239
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
1 QVERIFY(configSpy.wait());
240
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 GetConfigOperation* op3 = new GetConfigOperation();
241
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 op3->exec();
242
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 newconfig = op3->config();
243
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
1 QCOMPARE(newconfig->outputs().size(), 2);
244
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
1 }
245
246 1 void wayland_backend::verifyFeatures()
247 {
248
2/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 GetConfigOperation* op = new GetConfigOperation();
249
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 op->exec();
250
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 auto config = op->config();
251
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 QVERIFY(!config->supported_features().testFlag(Config::Feature::None));
252
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 QVERIFY(config->supported_features().testFlag(Config::Feature::Writable));
253
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 QVERIFY(!config->supported_features().testFlag(Config::Feature::PrimaryDisplay));
254
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
1 QVERIFY(config->supported_features().testFlag(Config::Feature::AdaptiveSync));
255
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 }
256
257
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
1 QTEST_GUILESS_MAIN(wayland_backend)
258
259 #include "wayland_backend.moc"
260