Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.h
T
torstenandCopilot b774f4035c Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 06:06:24 +02:00

82 lines
2.4 KiB
C++
Executable File

/**
* AES Function Topic Client test executable
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <AreaEffectSimulation/aes_ftc.h>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/logger.h>
#include <QObject>
#include <DDS/DDSConnector/dds_connector.h>
#include <memory>
#include "aes_test_base_export.h"
namespace AreaEffectSimulation
{
class AES_TEST_BASE_EXPORT TestBase : public QObject
{
Q_OBJECT
protected:
explicit TestBase(const char *loggerName, QObject *parent);
public:
bool testsSuccessful() const { return m_bTestsSuccessful; }
virtual bool init(int domainId, int exerciseId, int testId);
public Q_SLOTS:
virtual void startTest() = 0;
protected:
static bool waitForData(const std::function<bool()> &func);
bool checkAesItem(const AreaEffectSimulation::AesItem &a,
const AreaEffectSimulation::AesItem &b) const;
void failExit();
void onAesCreateReply(const Core::FunctionReplyObject &replyObject);
void onAesModifyReply(const Core::FunctionReplyObject &replyObject);
void onAesRemoveReply(const Core::FunctionReplyObject &replyObject);
void onAesTriggerReply(const Core::FunctionReplyObject &replyObject);
template <typename T>
void onAesChanged(const T &dataIn, DataModification modType, T &dataOut)
{
INFO_LOG() << "Got " << m_aesTypeName << " with mod type " << (int)modType
<< ", id: " << dataIn.id() << ", chargeType: " << dataIn.chargeStruct().chargeTypeId()
<< ", effectState: " << dataIn.effectStateId();
if (m_expectedAesId == dataIn.id())
{
DEBUG_LOG() << "Expected aes id - updating data for " << m_aesTypeName;
dataOut = dataIn;
}
if (modType == DataModification::eRemoved && dataOut.id() == dataIn.id())
{
DEBUG_LOG() << "Removed " << m_aesTypeName << " with id " << dataIn.id();
m_expectedAesId = dataIn.id();
}
}
protected:
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftc;
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtc;
int m_expectedAesId; //!< contains the id of the created aes
bool m_bIsCreatedRequest;
bool m_bExpectedFailure;
bool m_replyError;
bool m_bTestsSuccessful;
int m_testId;
QString m_aesTypeName;
};
int AES_TEST_BASE_EXPORT mainBase(int argc, char **argv,
const std::function<TestBase*()> &createFunc);
} // namespace AreaEffectSimulation