MCPcopy Create free account
hub / github.com/KDE/kdevelop / areaConstruction

Method areaConstruction

kdevplatform/sublime/tests/test_areaoperation.cpp:224–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void TestAreaOperation::areaConstruction()
225{
226 //check if areas has proper object names
227 QCOMPARE(m_area1->objectName(), QStringLiteral("Area 1"));
228 QCOMPARE(m_area2->objectName(), QStringLiteral("Area 2"));
229
230 //check that area1 contents is properly initialised
231 AreaViewsPrinter viewsPrinter1;
232 m_area1->walkViews(viewsPrinter1, m_area1->rootIndex());
233 QCOMPARE(viewsPrinter1.result, QStringLiteral("\n\
234[ view1.1.1 view1.2.1 view1.2.2 view1.3.1 ]\n\
235"));
236 AreaToolViewsPrinter toolViewsPrinter1;
237 m_area1->walkToolViews(toolViewsPrinter1, Sublime::AllPositions);
238 if constexpr (enableMultipleToolViewWidgets) {
239 QCOMPARE(toolViewsPrinter1.result, QStringLiteral("\n\
240toolview1.1.1 [ left ]\n\
241toolview1.2.1 [ bottom ]\n\
242toolview1.2.2 [ bottom ]\n\
243"));
244 } else {
245 QCOMPARE(toolViewsPrinter1.result, QStringLiteral("\n\
246toolview1.1.1 [ left ]\n\
247toolview1.2.1 [ bottom ]\n\
248"));
249 }
250
251 //check that area2 contents is properly initialised
252 AreaViewsPrinter viewsPrinter2;
253 m_area2->walkViews(viewsPrinter2, m_area2->rootIndex());
254 QCOMPARE(viewsPrinter2.result, QStringLiteral("\n\
255[ vertical splitter ]\n\
256 [ vertical splitter ]\n\
257 [ view2.1.1 view2.1.2 ]\n\
258 [ view2.4.1 ]\n\
259 [ horizontal splitter ]\n\
260 [ view2.2.1 ]\n\
261 [ view2.3.1 ]\n\
262"));
263 AreaToolViewsPrinter toolViewsPrinter2;
264 m_area2->walkToolViews(toolViewsPrinter2, Sublime::AllPositions);
265 if constexpr (enableMultipleToolViewWidgets) {
266 QCOMPARE(toolViewsPrinter2.result, QStringLiteral("\n\
267toolview2.1.1 [ bottom ]\n\
268toolview2.2.1 [ right ]\n\
269toolview2.3.1 [ top ]\n\
270toolview2.3.2 [ top ]\n\
271"));
272 } else {
273 QCOMPARE(toolViewsPrinter2.result, QStringLiteral("\n\
274toolview2.1.1 [ bottom ]\n\
275toolview2.2.1 [ right ]\n\
276toolview2.3.1 [ top ]\n\
277"));
278 }
279}
280
281void TestAreaOperation::mainWindowConstruction()

Callers

nothing calls this directly

Calls 3

walkViewsMethod · 0.80
rootIndexMethod · 0.80
walkToolViewsMethod · 0.80

Tested by

no test coverage detected