| 222 | } |
| 223 | |
| 224 | void 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\ |
| 240 | toolview1.1.1 [ left ]\n\ |
| 241 | toolview1.2.1 [ bottom ]\n\ |
| 242 | toolview1.2.2 [ bottom ]\n\ |
| 243 | ")); |
| 244 | } else { |
| 245 | QCOMPARE(toolViewsPrinter1.result, QStringLiteral("\n\ |
| 246 | toolview1.1.1 [ left ]\n\ |
| 247 | toolview1.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\ |
| 267 | toolview2.1.1 [ bottom ]\n\ |
| 268 | toolview2.2.1 [ right ]\n\ |
| 269 | toolview2.3.1 [ top ]\n\ |
| 270 | toolview2.3.2 [ top ]\n\ |
| 271 | ")); |
| 272 | } else { |
| 273 | QCOMPARE(toolViewsPrinter2.result, QStringLiteral("\n\ |
| 274 | toolview2.1.1 [ bottom ]\n\ |
| 275 | toolview2.2.1 [ right ]\n\ |
| 276 | toolview2.3.1 [ top ]\n\ |
| 277 | ")); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | void TestAreaOperation::mainWindowConstruction() |
nothing calls this directly
no test coverage detected