Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNEInternalTest.cpp
169665 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GNEInternalTest.cpp
15
/// @author Pablo Alvarez Lopez
16
/// @date Mar 2025
17
///
18
// Internal test system used for testing netedit
19
/****************************************************************************/
20
21
#include <netedit/GNEApplicationWindow.h>
22
#include <netedit/GNEViewNet.h>
23
#include <netedit/GNEViewParent.h>
24
#include <netedit/dialogs/fix/GNEFixAdditionalElementsDialog.h>
25
#include <netedit/dialogs/fix/GNEFixDemandElementsDialog.h>
26
#include <netedit/dialogs/fix/GNEFixNetworkElements.h>
27
#include <netedit/frames/GNETLSTable.h>
28
29
#include "GNEInternalTest.h"
30
31
// ===========================================================================
32
// member method definitions
33
// ===========================================================================
34
35
GNEInternalTest::GNEInternalTest(const std::string& testFile) :
36
InternalTest(testFile) {
37
}
38
39
40
GNEInternalTest::~GNEInternalTest() {}
41
42
43
void
44
GNEInternalTest::runNeteditInternalTests(GNEApplicationWindow* applicationWindow) {
45
if (!myTestFinished) {
46
myRunning = true;
47
const auto viewNet = applicationWindow->getViewNet();
48
const auto viewParent = viewNet->getViewParent();
49
// process every step
50
while (getCurrentStep() && myRunning) {
51
// get current step and set next step
52
const auto testStep = setNextStep();
53
// check if we have to process it in main windows, abstract view or specific view
54
if (testStep->getCategory() == InternalTestStep::Category::APP) {
55
applicationWindow->handle(this, testStep->getSelector(), testStep->getEvent());
56
} else if (testStep->getCategory() == InternalTestStep::Category::VIEW) {
57
viewNet->handle(this, testStep->getSelector(), testStep->getEvent());
58
} else if (testStep->getCategory() == InternalTestStep::Category::TLS_PHASES) {
59
viewParent->getTLSEditorFrame()->getTLSPhases()->handle(this, testStep->getSelector(), testStep->getEvent());
60
} else if (testStep->getCategory() == InternalTestStep::Category::TLS_PHASETABLE) {
61
viewParent->getTLSEditorFrame()->getTLSPhases()->getPhaseTable()->testTable(testStep->getTLSTableTest());
62
} else if (testStep->getCategory() == InternalTestStep::Category::FINISH) {
63
myTestFinished = true;
64
}
65
// check if update view after execute step
66
if (testStep->updateView()) {
67
viewNet->handle(this, FXSEL(SEL_PAINT, 0), nullptr);
68
}
69
}
70
}
71
}
72
73
/****************************************************************************/
74
75