From e8d07af3201895b0b4c11902c51c82f6f9e2173a Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Mon, 21 Sep 2026 02:44:07 +0200 Subject: [PATCH] Adapts shared tests and common code to generated rtiddsgen API Updates test suites and Lts/Common consumers to plain member access. --- .../Lts/Common/CodeGen/GrantleeWrappers.cpp | 24 ++--- .../Lts/Common/CodeGen/StructBuilder.cpp | 9 +- .../Lts/Common/CodeGen/svc_json.cpp.grantlee | 12 +++ .../svc_record_replay_plugin.cpp.grantlee | 32 +++++-- .../svc_record_replay_plugin.h.grantlee | 6 +- .../CodeGen/svc_topic_type_plugin.h.grantlee | 6 +- .../Common/LtsCoordinate/lts_coord_vector.h | 4 +- .../Common/LtsCoordinate/lts_coordinate.cpp | 10 +-- .../Lts/Common/LtsCoordinate/lts_coordinate.h | 32 +++---- .../LtsPluginManager/lts_plugin_loader.cpp | 4 +- .../LtsUtilsGuiDds/request_helper.cpp | 24 ++--- .../qt6-migrated-legatus/tests/CMakeLists.txt | 57 ++++++++++++ .../tests/test_aes_dtc.cpp | 6 +- .../tests/test_aes_enums.cpp | 74 +++++++--------- .../tests/test_alm_dtc.cpp | 8 +- .../tests/test_asm_dtc.cpp | 88 +++++++++++++------ .../tests/test_asm_enums.cpp | 56 +++++++++--- .../tests/test_bld_dtc.cpp | 66 +++++++++++++- .../tests/test_bld_enums.cpp | 55 ++++++++++-- .../tests/test_cod_dtc.cpp | 69 ++++++++++++++- .../tests/test_evl_dtc.cpp | 82 ++++++++++++++++- .../tests/test_gim_dtc.cpp | 65 +++++++++++++- .../tests/test_ism_dtc.cpp | 86 ++++++++++++++++-- .../tests/test_lts_coord_vector.cpp | 28 ++++-- .../tests/test_mdm_dtc.cpp | 4 +- .../tests/test_mrk_dtc.cpp | 80 +++++++++++++++-- .../tests/test_msg_dtc.cpp | 4 +- .../tests/test_nom_dtc.cpp | 4 +- .../tests/test_opm_dtc.cpp | 4 +- .../tests/test_oss_dtc.cpp | 4 +- .../tests/test_pdm_dtc.cpp | 69 +++++++++++++-- .../tests/test_ppm_dtc.cpp | 71 ++++++++++++++- .../tests/test_pre_dtc.cpp | 4 +- .../tests/test_rep_dtc.cpp | 4 +- .../tests/test_som_dtc.cpp | 4 +- .../tests/test_srm_dtc.cpp | 4 +- .../tests/test_srp_dtc.cpp | 4 +- .../tests/test_tab_dtc.cpp | 74 ++++++++++++++-- .../tests/test_taboc_dtc.cpp | 66 +++++++++++++- .../tests/test_tgt_dtc.cpp | 4 +- .../tests/test_whg_dtc.cpp | 4 +- 41 files changed, 1076 insertions(+), 235 deletions(-) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GrantleeWrappers.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GrantleeWrappers.cpp index 584d62d87..8c2734e52 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GrantleeWrappers.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GrantleeWrappers.cpp @@ -43,7 +43,8 @@ QString DataTopicWrapper::typeFq() const QString MemberInformationWrapper::ddsToQVariant() const { - return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral("())"); + // rtiddsgen 7.7 generates plain public members - access them directly. + return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral(")"); } QString MemberInformationWrapper::qVariantToDds() const @@ -51,7 +52,7 @@ QString MemberInformationWrapper::qVariantToDds() const const QString ddsType = isOptional() ? (QStringLiteral("dds::core::optional<") + cppDdsType() + QLatin1Char('>')) : (cppDdsType()); - return QStringLiteral("data.") + cppMemberName() + QStringLiteral("() = fromQVariant<") + ddsType + + return QStringLiteral("data.") + cppMemberName() + QStringLiteral(" = fromQVariant<") + ddsType + QStringLiteral(">(q.value(i++))"); } @@ -61,14 +62,15 @@ QString MemberInformationWrapper::ddsToJsonElement() const if (cppMemberName().isEmpty()) return QStringLiteral("obj[QStringLiteral(\"") + cppType() + QStringLiteral("\")] = element;"); - const QString memberAccess = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()"); + // rtiddsgen 7.7 generates plain public members for every kind of + // member (struct or not), so no getter call is emitted. + const QString memberAccess = cppMemberName(); if (!isOptional()) return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() + QStringLiteral("element.") + memberAccess + cppToJsonPost(); - const QString optionalAccess = - isCppStruct() ? cppMemberName() + QStringLiteral(".is_set()") : cppMemberName() + QStringLiteral("().is_set()"); - const QString getValue = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()"); + const QString optionalAccess = cppMemberName() + QStringLiteral(".is_set()"); + const QString getValue = cppMemberName(); return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") + QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() + QStringLiteral("*element.") + getValue + cppToJsonPost(); @@ -86,12 +88,10 @@ QString MemberInformationWrapper::jsonElementToDds() const if (isOptional()) ret += QStringLiteral("if (!val.isNull()) "); - if (isCppStruct()) - ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() + - QStringLiteral("val") + cppFromJsonPost(); - else - ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral("(") + cppFromJsonPre2() + - QStringLiteral("val") + cppFromJsonPost() + QStringLiteral(")"); + // rtiddsgen 7.7 generates plain public members - assign instead of + // calling a setter. + ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() + + QStringLiteral("val") + cppFromJsonPost(); return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp index ecf597add..574cbaee7 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp @@ -874,6 +874,13 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation& mi) const datatype == QLatin1String("long long")) { mi.cpp.type = QStringLiteral("qint64"); + // IDL `long long` is int64_t (long) in the rtiddsgen 4.7 output, while the Qt side is + // qint64 (long long). Those are distinct types, so assignments such as + // `optional = optional` do not compile. Carry the generated type + // separately, as the sequence branch below already does, so the DDS-facing code + // emitted from cppDdsType() names the type the struct member really has. The spelling + // is the one rtiddsgen itself writes, matching what the `long` branch does with int32_t. + mi.cpp.ddsType = QStringLiteral("int64_t"); mi.cpp.fromVariantPost = QStringLiteral(".toLongLong()"); mi.cpp.fromJsonPost = QStringLiteral(".toDouble()"); mi.cpp.toJsonPre = QStringLiteral("static_cast("); @@ -1039,7 +1046,7 @@ QVector StructBuilder::buildDbTableInformationFromIdlData(con pre += columnNamePrefix; pre += member.name + QLatin1Char('_'); ret += buildDbTableInformationFromIdlData(cttiChild, tableName, StructBuilder::camelCaseToUnderline(pre), - cppStructure + member.name + QStringLiteral("().")); + cppStructure + member.name + QStringLiteral(".")); continue; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_json.cpp.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_json.cpp.grantlee index 7b13e8f3f..2f3f082e4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_json.cpp.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_json.cpp.grantlee @@ -48,6 +48,18 @@ QJsonValue toJson(qint64 vec) { return QJsonValue(QString::number(vec)); } +// IDL 64-bit integers map to int64_t, which is 'long' on LP64 and therefore +// distinct from qint64 ('long long'); without this overload the generic +// toJson(std::vector) is ambiguous for sequence members. +QJsonValue toJson(long vec) +{ + return QJsonValue(QString::number(vec)); +} +template<> +long fromJson(const QJsonValue &val, type) +{ + return val.toString().toLong(); +} // std::string QJsonValue toJson(const std::string &element) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee index 42cb88a65..57e5f619c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee @@ -198,6 +198,17 @@ long long fromQVariant(const QVariant &val, type) return val.toLongLong(); } +// rtiddsgen 4.7 spells the 64 bit integer members int64_t, which is `long` on LP64 and thus +// a different type from the Qt side's qint64 (`long long`). The tag dispatch above is keyed on +// the exact type, so the generated type needs its own conversion even though the two are the +// same width. GrantleeWrappers::cppDdsType() names the generated member type, so this is the +// overload the record replay code instantiates for those members. +template<> +int64_t fromQVariant(const QVariant &val, type) +{ + return static_cast(val.toLongLong()); +} + template<> double fromQVariant(const QVariant &val, type) { @@ -555,7 +566,7 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash for (const auto &sample : samples) { const DATA &data = sample.data(); - INFO_LOG(m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }}(); + INFO_LOG(m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }}; {% for row in dt.recTable.cppMember %} q.bindValue(QStringLiteral(":{{ row.dbColumnName }}"), {{ row.ddsToQVariant }}); @@ -565,7 +576,10 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash if (!q.exec()) return false; - minRecordSampleTime = std::min(minRecordSampleTime, data.sampleTime()); + // rtiddsgen 4.7 declares sample_time as int64_t (long), while the record + // boundary is qint64 (long long); std::min requires both arguments to be + // the same type, so narrow the generated member explicitly. + minRecordSampleTime = std::min(minRecordSampleTime, static_cast(data.sampleTime)); } } @@ -645,10 +659,10 @@ bool RecordReplayPlugin::readLastSnapshotFor{{ dt.name }}(NSqlQuery &q, qint64 s {% endfor %} if (bIsAlive) - m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data); + m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data); else - m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data); - m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}()); + m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data); + m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}); } m_snapshot{{ dt.name }}MapTime = timeSnapshot; @@ -677,10 +691,10 @@ bool RecordReplayPlugin::read{{ dt.name }}(NSqlQuery &q, qint64 fromTime, qint64 {% endfor %} if (bIsAlive) - m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data); + m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data); else - m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data); - m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}()); + m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data); + m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}); } return true; } @@ -795,7 +809,7 @@ void RecordReplayPlugin::clearData{{ dt.name }}() {{ dt.name }} tmpData; for (auto key : m_{{ dt.nameFlc }}Keys) { - tmpData.{{ dt.key.name }}(key); + tmpData.{{ dt.key.name }} = key; m_dts{{ dt.name }}->remove(tmpData); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee index 2aded1edd..4ce740bdf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee @@ -18,8 +18,10 @@ #include <{{ include_prefix }}/{{ namespace_abbr }}_dts_types.h> #include <{{ include_prefix }}/logger.h> -// TODO: Problem with QT5_WRAP_CPP ... -#include <../../Common/PluginInterfaces/record_replay_plugin.h> +// Resolved from the Lts include root (see include_directories(BEFORE .../Lts) +// in the root CMakeLists); the old <../../Common/...> spelling only worked +// for in-source builds. +#include #include diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_topic_type_plugin.h.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_topic_type_plugin.h.grantlee index ea0b10408..9a9d3ff9f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_topic_type_plugin.h.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_topic_type_plugin.h.grantlee @@ -15,8 +15,10 @@ #include #include -// TODO: Problem with QT5_WRAP_CPP ... -#include <../../DDS/Generic/topic_type_plugin.h> +// Resolved from the Lts include root (see include_directories(BEFORE .../Lts) +// in the root CMakeLists); the old <../../DDS/...> spelling only worked for +// in-source builds because moc/gcc do not resolve it relative to this file. +#include namespace {{ namespace }} { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coord_vector.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coord_vector.h index 7e2753c2b..e34354777 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coord_vector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coord_vector.h @@ -2,7 +2,7 @@ #pragma once -#include "ltscoordinate_export.h" +#include #include #include @@ -48,7 +48,7 @@ class LTSCOORDINATE_EXPORT LtsCoordVector utmVectorRef.reserve(m_geo_coordinates.size()); for (const auto& geoCoord : std::as_const(m_geo_coordinates)) - utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat(), zone)); + utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat, zone)); } protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.cpp index 566a6082f..388db610c 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.cpp @@ -29,13 +29,13 @@ double LtsCoordinate::elevationAt(double defaultElevation, bool* bIsCovered) con if (!std::isnan(m_elevation)) return m_elevation; if (m_getElevationCB) - m_elevation = m_getElevationCB(m_geo.lon(), m_geo.lat(), defaultElevation, bIsCovered); + m_elevation = m_getElevationCB(m_geo.lon, m_geo.lat, defaultElevation, bIsCovered); return m_elevation; } void LtsCoordinate::setZValueAccordingElevation(double defaultElevation) { - m_geo.z(elevationAt(defaultElevation)); + m_geo.z = elevationAt(defaultElevation); } double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaultElevation, bool* bIsCovered) @@ -46,7 +46,7 @@ double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaul void LtsCoordinate::replaceZValueByElevationIfValue(double zValueToBeReplaced, double defaultElevation) { - if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z())) || qFuzzyCompare(m_geo.z(), zValueToBeReplaced)) + if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z)) || qFuzzyCompare(m_geo.z, zValueToBeReplaced)) setZValueAccordingElevation(defaultElevation); } @@ -79,7 +79,7 @@ void LtsCoordinate::convertGeoToUtm() const int zone = -1; - if (std::isnan(m_geo.lon()) || std::isnan(m_geo.lat())) + if (std::isnan(m_geo.lon) || std::isnan(m_geo.lat)) { fprintf(stderr, "Error while fromGeographic, value is NaN\n"); m_utm2D = LtsCoordTrans::UtmCoordinate(); @@ -90,7 +90,7 @@ void LtsCoordinate::convertGeoToUtm() const ++s_conversion_counter; #endif - m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone); + m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone); Q_ASSERT_X(m_utm2D.zone > 0, "LtsCoordinate", "zone has to be set"); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.h index d79314f70..31adb9ac5 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/lts_coordinate.h @@ -2,7 +2,7 @@ #pragma once -#include "ltscoordinate_export.h" +#include #include #include @@ -35,7 +35,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate explicit LtsCoordinate(const Core::GeoPosition& geoPos) : m_geo(geoPos) {} - explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon(), geoPos2D.lat(), std::nan("")) {} + explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon, geoPos2D.lat, std::nan("")) {} LtsCoordinate(const LtsCoordTrans::UtmCoordinate& utm2D, double zValue) = delete; @@ -67,7 +67,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate bool hasGeo() const { - return !(valueIsNullOrNan(m_geo.lon()) || valueIsNullOrNan(m_geo.lat())); + return !(valueIsNullOrNan(m_geo.lon) || valueIsNullOrNan(m_geo.lat)); } bool hasUtm() const @@ -95,7 +95,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate Core::GeoPosition2D geoPosition2D() const { - return Core::GeoPosition2D(m_geo.longitude, m_geo.latitude); + return Core::GeoPosition2D(m_geo.lon, m_geo.lat); } const LtsCoordTrans::UtmCoordinate& utmCoordinate() const @@ -107,23 +107,23 @@ class LTSCOORDINATE_EXPORT LtsCoordinate double& rz() { - return m_geo.altitude; + return m_geo.z; } double z() const { - return m_geo.z(); + return m_geo.z; } void setZ(double value) { - m_geo.z(value); + m_geo.z = value; } LtsCoordTrans::UtmCoordinate utmCoordinateDiffZone(int zone) const { - m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone); + m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone); return m_utm2D_differentZone; } @@ -146,17 +146,17 @@ class LTSCOORDINATE_EXPORT LtsCoordinate QPointF toGeoPointF() const { - return QPointF(m_geo.lon(), m_geo.lat()); + return QPointF(m_geo.lon, m_geo.lat); } QPoint3D toGeoPoint3D() const { - return QPoint3D(m_geo.lon(), m_geo.lat(), m_geo.z()); + return QPoint3D(m_geo.lon, m_geo.lat, m_geo.z); } UtmCoordinate3D toUtmCoordinate3D() const { - return UtmCoordinate3D(utmCoordinate(), m_geo.z()); + return UtmCoordinate3D(utmCoordinate(), m_geo.z); } using elevationCbFunc = std::function; @@ -174,7 +174,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate double heightOverElevation() const { - return m_geo.z() - elevationAt(); + return m_geo.z - elevationAt(); } double distanceUtm2D(const LtsCoordinate& other) const @@ -203,13 +203,13 @@ class LTSCOORDINATE_EXPORT LtsCoordinate void clearGeo() const { clearGeoLonLat(); - m_geo.z(std::nan("")); + m_geo.z = std::nan(""); } void clearGeoLonLat() const { - m_geo.lon(0); - m_geo.lat(0); + m_geo.lon = 0; + m_geo.lat = 0; } void clearUtm() const @@ -245,7 +245,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate const auto& utmTemp = utmCoordinateInternal(zone); pntRef.rx() = utmTemp.x; pntRef.ry() = utmTemp.y; - pntRef.rz() = m_geo.z(); + pntRef.rz() = m_geo.z; } protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_loader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_loader.cpp index 8dfe3e005..c870472a4 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_loader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_loader.cpp @@ -293,7 +293,9 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType, } const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended) - const QVector iidParameters = jsonIid.splitRef(QLatin1Char(':')); + // Qt6: QStringRef/QString::splitRef were removed; QStringView::split + // provides the same zero-copy tokenization. + const QList iidParameters = QStringView{jsonIid}.split(QLatin1Char(':')); DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.cpp index 01fe46cb7..2141663a7 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.cpp @@ -46,21 +46,15 @@ RequestHelper::RequestHelper(QObject* parent, bool quiet, } void RequestHelper::addRequest(const std::function& requestFunction, - const std::function& baseReplyHandler) + const std::function& baseReplyHandler) { m_requestFunctions.append(RequestFunctionContainer(requestFunction, baseReplyHandler)); } -bool RequestHelper::requestReply(const FunctionReplyType& baseReply) +bool RequestHelper::requestReply(const Core::FunctionReply& baseReply) { -#ifdef BUILD_RTI - // Bei BUILD_RTI=ON: baseReply ist Core::FunctionReply, cast von dds::core::Reference - // Die Implementation erwartet Core::FunctionReplyObject - const Core::FunctionReplyObject fro(baseReply.id(), baseReply.errorString(), baseReply.errorParams()); -#else - // Stub-Version: nur id und error string - const Core::FunctionReplyObject fro(baseReply.id(), baseReply.str().c_str()); -#endif + // rtiddsgen 7.7 generates plain public members (no getters/setters) + const Core::FunctionReplyObject fro(baseReply.id, baseReply.errorString, baseReply.errorParams); return _requestReply(fro, &baseReply); } @@ -69,7 +63,7 @@ bool RequestHelper::requestReply(const Core::FunctionReplyObject& replyObject) return _requestReply(replyObject, nullptr); } -bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const FunctionReplyType* baseReply) +bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply) { m_errorString = fro.translated(); @@ -100,14 +94,8 @@ bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Fu if (baseReply) m_singleRequestCustomFunctionReply(*baseReply); else -#ifdef BUILD_RTI m_singleRequestCustomFunctionReply( Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo())); -#else - // Stub-Version: FunctionReply mit passendem Konstruktor - m_singleRequestCustomFunctionReply( - Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo())); -#endif } if (fro.error()) @@ -195,7 +183,7 @@ void RequestHelper::slotNextRequest() void RequestHelper::startSingleBackgroundRequest( const std::function& requestFunction, - const std::function& baseReplyHandler) + const std::function& baseReplyHandler) { m_blockingCall = false; startSingleRequest(requestFunction, baseReplyHandler); diff --git a/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt index 67a908753..1a65d633b 100644 --- a/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/tests/CMakeLists.txt @@ -116,6 +116,54 @@ if(BUILD_TESTING) add_dependencies(migration_tests svcFltCommon) endif() + # The *_dtc/*_enums tests include the rtiddsgen/codegen outputs of + # the migrated services from ${CMAKE_BINARY_DIR}/Lts/Services. The + # OFF-era stub copies these tests used to resolve (include/ and + # Lts/Services source stubs) were removed, so the codegen of each + # service must run before migration_tests compiles - the same + # ordering the svcFlmCommon/svcFltCommon blocks above provide. + # Nothing else in the docker_build.sh make list builds these + # service targets, so without these deps the generated headers are + # missing on a fresh build. + foreach(_svc_common IN ITEMS + svcAesCommon svcAlmCommon svcAsmCommon svcAvmCommon svcCodCommon + svcEemCommon svcEsmCommon svcEscCommon svcEvlCommon svcExmCommon + svcGimCommon svcIsmCommon svcMdmCommon svcMsgCommon svcMrkCommon + svcNomCommon svcOpmCommon svcOssCommon svcPdmCommon svcPpmCommon + svcPreCommon svcRepCommon svcSomCommon svcSrmCommon svcSrpCommon + svcTgtCommon svcWhgCommon) + if(TARGET ${_svc_common}) + add_dependencies(migration_tests ${_svc_common}) + endif() + endforeach() + + # test_core_enums includes Lts/DDS/Core/core_enums.hpp, an rtiddsgen + # output built by ddscore. ddscore is in the make target list, but a + # parallel make gives no ordering between it and migration_tests. + if(TARGET ddscore) + add_dependencies(migration_tests ddscore) + endif() + + # test_tab_dtc includes the TrainingAreaBase rtiddsgen/codegen + # outputs (tab.hpp, tab_dtc.h) from build4/Lts/Proxies - same + # ordering requirement as the service blocks above. + if(TARGET svcTabCommon) + add_dependencies(migration_tests svcTabCommon) + endif() + + # test_taboc_dtc includes the TrainingAreaBaseOC outputs + # (taboc.hpp, taboc_dtc.h) from build4/Lts/Proxies likewise. + if(TARGET svcTabocCommon) + add_dependencies(migration_tests svcTabocCommon) + endif() + + # test_bld_dtc / test_bld_enums include the Buildings outputs + # (bld.hpp, bld_dtc.h, bld_enums.hpp) from build4/Lts/Proxies + # likewise (the CONFIGURE_FILE stub copy was removed). + if(TARGET svcBldCommon) + add_dependencies(migration_tests svcBldCommon) + endif() + # Enable Qt Meta-Object Compiler for tests with Q_OBJECT set_target_properties(migration_tests PROPERTIES AUTOMOC ON) @@ -139,6 +187,15 @@ if(BUILD_TESTING) ${CMAKE_SOURCE_DIR}/Lts/Common/LtsTimelineClassic ${CMAKE_BINARY_DIR}/Lts/Services ${CMAKE_SOURCE_DIR}/Lts/Services + ${CMAKE_SOURCE_DIR}/Lts/Proxies + ${CMAKE_BINARY_DIR}/Lts/Proxies + # Source headers under Lts/DDS/DDSConnector and + # Lts/Common/LtsCoordTrans include their build-tree export + # headers by bare quoted name (ddsconnector_export.h, + # ltscoordtrans_export.h); the OFF-stub copies under include/ + # that used to satisfy those includes were removed. + ${CMAKE_BINARY_DIR}/Lts/DDS/DDSConnector + ${CMAKE_BINARY_DIR}/Lts/Common/LtsCoordTrans ${CMAKE_SOURCE_DIR}/Z/src/NGLLogger ) diff --git a/qt6-after/qt6-migrated-legatus/tests/test_aes_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_aes_dtc.cpp index 548117020..c5b2b9033 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_aes_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_aes_dtc.cpp @@ -1,14 +1,16 @@ /** * @file test_aes_dtc.cpp - * @brief Tests für AreaEffectSimulation Dtc/Ftc Stub-Header + * @brief Tests für die generierte AreaEffectSimulation Dtc/Ftc-Schnittstelle * - * Diese Tests validieren dass die generierten DDS-Stub-Header korrekt kompilieren. + * Diese Tests validieren die von CODEGEN_CLIENT_TOPICS_IFC aus aes_service.xml + * generierten Header (aes_dtc.h/aes_ftc.h) aus dem Build-Tree. */ #include // Include des zu testenden Headers #include "AreaEffectSimulation/aes_dtc.h" +#include "AreaEffectSimulation/aes_ftc.h" /** * @test Test dass der Header kompiliert und Namespace existiert diff --git a/qt6-after/qt6-migrated-legatus/tests/test_aes_enums.cpp b/qt6-after/qt6-migrated-legatus/tests/test_aes_enums.cpp index af85417b9..1d1892bd3 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_aes_enums.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_aes_enums.cpp @@ -1,61 +1,53 @@ /** * @file test_aes_enums.cpp - * @brief Tests für AreaEffectSimulation Enum-Header + * @brief Verhaltenstests für die generierten AreaEffectSimulation-Enumerationen * - * Diese Tests validieren dass die generierten DDS-Enum-Header korrekt kompilieren. + * Diese Tests prüfen den von rtiddsgen aus aes_enums.idl generierten Header + * (Lts/Services/AreaEffectSimulation/aes_enums.hpp) aus dem Build-Tree. + * Die Werte stammen aus aes_service.xml (z.B. AesExplosionGeometry für + * Explosionsgeometrien, AesEffectState für den Effekt-Zustandsautomaten). */ -#include - -// Include des zu testenden Headers #include "Lts/Services/AreaEffectSimulation/aes_enums.hpp" +#include +#include + /** - * @test Test dass der Header kompiliert und Enums existieren + * @test AesExplosionGeometry muss mit den Werten aus aes_enums.idl generiert werden. */ -TEST(AesEnumsTest, HeaderCompilesAndEnumsExist) +TEST(AesEnumsTest, ExplosionGeometryValues) { - // Verify that enum classes are accessible - using namespace AreaEffectSimulation; - - // Create enum values - SymbolAppearance appearance = SymbolAppearance::Solid; - SymbolVisibility visibility = SymbolVisibility::Visible; - - EXPECT_EQ(appearance, SymbolAppearance::Solid); - EXPECT_EQ(visibility, SymbolVisibility::Visible); - - // Test other enum values - EXPECT_EQ(SymbolAppearance::Dashed, static_cast(1)); - EXPECT_EQ(SymbolAppearance::Dotted, static_cast(2)); - EXPECT_EQ(SymbolVisibility::Hidden, static_cast(1)); + static_assert(std::is_enum<::AreaEffectSimulation::AesExplosionGeometry>::value, + "AesExplosionGeometry muss aus aes_enums.hpp vorliegen"); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesExplosionGeometry::EgAimPoint), 0); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesExplosionGeometry::EgRadial), 1); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesExplosionGeometry::EgArea), 2); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesExplosionGeometry::EgLine), 3); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesExplosionGeometry::EgPoint), 4); } /** - * @test Test dass UnitSymbolPosition struct korrekt ist + * @test AesEffectState muss mit den Werten aus aes_enums.idl generiert werden. */ -TEST(AesEnumsTest, UnitSymbolPositionStruct) +TEST(AesEnumsTest, EffectStateValues) { - using namespace AreaEffectSimulation; - - // Test default initialization - UnitSymbolPosition pos1; - EXPECT_DOUBLE_EQ(pos1.x, 0.0); - EXPECT_DOUBLE_EQ(pos1.y, 0.0); - - // Test custom initialization - UnitSymbolPosition pos2{10.5, 20.5}; - EXPECT_DOUBLE_EQ(pos2.x, 10.5); - EXPECT_DOUBLE_EQ(pos2.y, 20.5); - - // Test assignment - pos1 = pos2; - EXPECT_DOUBLE_EQ(pos1.x, 10.5); - EXPECT_DOUBLE_EQ(pos1.y, 20.5); + static_assert(std::is_enum<::AreaEffectSimulation::AesEffectState>::value, + "AesEffectState muss aus aes_enums.hpp vorliegen"); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsUnknown), 0); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsExpired), 1); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsRemoved), 2); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsCreated), 4); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsPrepared), 5); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsActivated), 6); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsPaused), 7); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsReceived), 8); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsFired), 9); + EXPECT_EQ(static_cast(::AreaEffectSimulation::AesEffectState::EsError), 255); } /** - * @test Test dass Header mehrfach inkludierbar ist (include guard) + * @test Include-Guard: mehrfaches Einbinden des generierten Headers ist erlaubt. */ TEST(AesEnumsTest, MultipleIncludeGuard) { @@ -65,4 +57,4 @@ TEST(AesEnumsTest, MultipleIncludeGuard) // If we reach this point, the include guard works EXPECT_TRUE(true); -} \ No newline at end of file +} diff --git a/qt6-after/qt6-migrated-legatus/tests/test_alm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_alm_dtc.cpp index fdc8c837b..d39da946a 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_alm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_alm_dtc.cpp @@ -1,15 +1,15 @@ /** * @file test_alm_dtc.cpp - * @brief Minimal test for AlarmManagement/alm_dtc.h header inclusion + * @brief Minimal test for the generated AlarmManagement Dtc/Ftc headers * - * This test verifies that the stub header can be included without errors. - * The actual Dtc/Ftc classes are generated by ddsdtc tool. + * This test verifies that the headers generated by CODEGEN_CLIENT_TOPICS_IFC + * from alm_service.xml (build-tree alm_dtc.h/alm_ftc.h) compile without errors. */ #include -// Include the stub header - this test ensures it compiles #include "AlarmManagement/alm_dtc.h" +#include "AlarmManagement/alm_ftc.h" TEST(AlarmManagementDtc, HeaderCompiles) { diff --git a/qt6-after/qt6-migrated-legatus/tests/test_asm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_asm_dtc.cpp index 67a4bff23..7af609266 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_asm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_asm_dtc.cpp @@ -1,41 +1,77 @@ /** * @file test_asm_dtc.cpp - * @brief Tests for AssetManagement Dtc stub header compilation + * @brief Verhaltenstests für die generierte AssetManagement Dtc/Ftc-Schnittstelle + * + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus asm_service.xml + * generierten Header (Lts/Services/AssetManagement/asm_dtc.h bzw. asm_ftc.h) + * aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus asm.hpp verifiziert, auf die + * der migrierte Code (asm_dtc_impl_custom.cpp, main_handler.cpp) zugreift. */ -#include #include "AssetManagement/asm_dtc.h" +#include "AssetManagement/asm_ftc.h" -// Test that the header compiles and provides expected forward declarations -TEST(AsmDtcTest, HeaderCompilesSuccessfully) +#include +#include +#include + +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(asm_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that asm_dtc.h compiles without errors - // The header provides forward declarations for DDS-generated Dtc/Ftc classes + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); EXPECT_TRUE(true); } -TEST(AsmDtcTest, NamespaceStructureExists) +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(asm_dtc_Generated, IdentifiersMatchService) { - // Verify that the AssetManagement namespace exists - using namespace AssetManagement; - - // Verify that the Interface namespace exists within AssetManagement - using namespace AssetManagement::Interface; - - // Forward declaration should be available (pointer type should compile) - Dtc* dtc_ptr = nullptr; - Ftc* ftc_ptr = nullptr; - - EXPECT_EQ(dtc_ptr, nullptr); - EXPECT_EQ(ftc_ptr, nullptr); + EXPECT_STREQ(AssetManagement::Interface::Dtc::identifier(), "AssetManagement.Interface.Dtc"); + EXPECT_STREQ(AssetManagement::Interface::Ftc::identifier(), "AssetManagement.Interface.Ftc"); } -TEST(AsmDtcTest, ForwardDeclarationsAreUsable) +/** + * @test Die DDS-Typen aus asm.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * Asset (id, name, assetTypeId, locationId, subLocation), die der migrierte + * AssetManagement-Code direkt als Felder nutzt. + */ +TEST(asm_dtc_Generated, AssetHasPlainMembers) { - // Test that forward-declared types can be used in function signatures - auto use_dtc = [](AssetManagement::Interface::Dtc* ptr) { return ptr != nullptr; }; - auto use_ftc = [](AssetManagement::Interface::Ftc* ptr) { return ptr != nullptr; }; + using Asset = AssetManagement::Asset; - EXPECT_FALSE(use_dtc(nullptr)); - EXPECT_FALSE(use_ftc(nullptr)); -} \ No newline at end of file + static_assert(std::is_base_of<::Core::BaseEntity, Asset>::value, + "Asset muss von Core::BaseEntity abgeleitet sein (id/name/isUsed)"); + static_assert(std::is_same::value, + "id muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "name muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "assetTypeId muss ein plain AssetType-Member sein"); + static_assert(std::is_same::value, + "locationId muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "subLocation muss ein plain int32_t-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(asm_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "AssetManagement/asm_dtc.h" +#include "AssetManagement/asm_ftc.h" + EXPECT_TRUE(true); +} diff --git a/qt6-after/qt6-migrated-legatus/tests/test_asm_enums.cpp b/qt6-after/qt6-migrated-legatus/tests/test_asm_enums.cpp index cb6544496..baa75d317 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_asm_enums.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_asm_enums.cpp @@ -1,29 +1,57 @@ /** * @file test_asm_enums.cpp - * @brief Tests for AssetManagement enum definitions + * @brief Verhaltenstests für die generierten AssetManagement-Enumerationen + * + * Diese Tests prüfen den von rtiddsgen aus asm_enums.idl generierten Header + * (Lts/Services/AssetManagement/asm_enums.hpp) aus dem Build-Tree. + * Die Werte stammen aus asm_service.xml (MapType, ShutdownAction, AssetType). */ #include "Lts/Services/AssetManagement/asm_enums.hpp" #include +#include -TEST(AsmEnumsTest, SymbolAppearanceEnumValues) +/** + * @test MapType muss mit den Werten aus asm_enums.idl generiert werden. + */ +TEST(AsmEnumsTest, MapTypeValues) { - EXPECT_EQ(static_cast(AssetManagement::SymbolAppearance::Solid), 0); - EXPECT_EQ(static_cast(AssetManagement::SymbolAppearance::Dashed), 1); - EXPECT_EQ(static_cast(AssetManagement::SymbolAppearance::Dotted), 2); + static_assert(std::is_enum<::AssetManagement::MapType>::value, + "MapType muss aus asm_enums.hpp vorliegen"); + EXPECT_EQ(static_cast(::AssetManagement::MapType::Unknown), 0); + EXPECT_EQ(static_cast(::AssetManagement::MapType::Topographic), 1); + EXPECT_EQ(static_cast(::AssetManagement::MapType::Aerial), 2); + EXPECT_EQ(static_cast(::AssetManagement::MapType::Feature), 3); + EXPECT_EQ(static_cast(::AssetManagement::MapType::Elevation), 4); + EXPECT_EQ(static_cast(::AssetManagement::MapType::SceneObjects), 5); } -TEST(AsmEnumsTest, SymbolVisibilityEnumValues) +/** + * @test ShutdownAction muss mit den Werten aus asm_enums.idl generiert werden. + */ +TEST(AsmEnumsTest, ShutdownActionValues) { - EXPECT_EQ(static_cast(AssetManagement::SymbolVisibility::Visible), 0); - EXPECT_EQ(static_cast(AssetManagement::SymbolVisibility::Hidden), 1); + static_assert(std::is_enum<::AssetManagement::ShutdownAction>::value, + "ShutdownAction muss aus asm_enums.hpp vorliegen"); + EXPECT_EQ(static_cast(::AssetManagement::ShutdownAction::NoAction), 0); + EXPECT_EQ(static_cast(::AssetManagement::ShutdownAction::Logout), 1); + EXPECT_EQ(static_cast(::AssetManagement::ShutdownAction::Shutdown), 2); + EXPECT_EQ(static_cast(::AssetManagement::ShutdownAction::Reboot), 3); } -TEST(AsmEnumsTest, UnitSymbolPositionDefaultValues) +/** + * @test AssetType muss mit den Werten aus asm_enums.idl generiert werden. + */ +TEST(AsmEnumsTest, AssetTypeValues) { - AssetManagement::UnitSymbolPosition pos; - EXPECT_DOUBLE_EQ(pos.x, 0.0); - EXPECT_DOUBLE_EQ(pos.y, 0.0); - EXPECT_DOUBLE_EQ(pos.z, 0.0); -} \ No newline at end of file + static_assert(std::is_enum<::AssetManagement::AssetType>::value, + "AssetType muss aus asm_enums.hpp vorliegen"); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::Unknown), 0); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::Workstation), 1); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::Printer), 2); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::Beamer), 3); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::ProjectionWorkstation), 4); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::MobileAfterActionVehicle), 5); + EXPECT_EQ(static_cast(::AssetManagement::AssetType::AdlerSAA), 6); +} diff --git a/qt6-after/qt6-migrated-legatus/tests/test_bld_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_bld_dtc.cpp index 33577242f..76a6e6d3a 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_bld_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_bld_dtc.cpp @@ -1,16 +1,74 @@ /** * @file test_bld_dtc.cpp - * @brief Compilation test for Buildings/bld_dtc.h + * @brief Verhaltenstests für die generierte Buildings Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus der bld_service.xml + * generierten Header (Lts/Proxies/Buildings/bld_dtc.h bzw. bld_ftc.h) aus dem + * Build-Tree. Der OFF-Stub include/Buildings/bld_dtc.h wurde entfernt, da er + * den generierten Header verschattet hat. Zusätzlich werden die plainen + * DDS-Typ-Member aus bld.hpp verifiziert (SwitchRelayRequest), die die + * migrierten Consumer (relay_info_handler, VWM) direkt als Felder nutzen. */ #include "Buildings/bld_dtc.h" +#include "Buildings/bld_ftc.h" #include +#include +#include -TEST(bld_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(bld_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Proxy-Namensschema folgen. + */ +TEST(bld_dtc_Generated, IdentifiersMatchProxy) +{ + EXPECT_STREQ(Buildings::Interface::Dtc::identifier(), "Buildings.Interface.Dtc"); + EXPECT_STREQ(Buildings::Interface::Ftc::identifier(), "Buildings.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus bld.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * SwitchRelayRequest (buildingId/assetId/state), den relay_info_handler + * und die VWM-Steuerung als Felder nutzen. + */ +TEST(bld_dtc_Generated, SwitchRelayRequestHasPlainMembers) +{ + using SwitchRelayRequest = Buildings::SwitchRelayRequest; + + static_assert(std::is_same::value, + "buildingId muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "assetId muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "state muss ein plain Buildings::StateSetRelay-Member sein"); + static_assert(std::is_same::value, + "number muss ein plain int32_t-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(bld_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "Buildings/bld_dtc.h" +#include "Buildings/bld_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_bld_enums.cpp b/qt6-after/qt6-migrated-legatus/tests/test_bld_enums.cpp index 8bf3fa2d4..18c7ada6c 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_bld_enums.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_bld_enums.cpp @@ -1,16 +1,61 @@ /** * @file test_bld_enums.cpp - * @brief Compilation test for Buildings/bld_enums.hpp + * @brief Verhaltenstests für die generierten Buildings-Enumerationen * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von rtiddsgen aus bld_enums.idl generierten Header + * (Lts/Proxies/Buildings/bld_enums.hpp) aus dem Build-Tree. Die frühere + * CONFIGURE_FILE-Stub-Kopie (BuildingType/BuildingStatus/BuildingInfo) wurde + * entfernt, da sie bei jedem CMake-Reconfigure die echten generierten + * Enumerationen überschrieben hat. */ -#include "Lts/Proxies/Buildings/bld_enums.hpp" +#include "Buildings/bld_enums.hpp" #include +#include -TEST(bld_enums_Compilation, HeaderCompiles) +/** + * @test EffectTypeEnum muss mit den Werten aus bld_enums.idl generiert werden. + */ +TEST(bld_enums_Generated, EffectTypeEnumValues) { - // This test verifies that the header compiles without errors + static_assert(std::is_enum<::Buildings::EffectTypeEnum>::value, + "EffectTypeEnum muss aus bld_enums.hpp vorliegen"); + static_assert(static_cast(::Buildings::EffectTypeEnum::Undefined) == 0, + "EffectTypeEnum::Undefined muss 0 sein"); + static_assert(static_cast(::Buildings::EffectTypeEnum::Relay) == 1, + "EffectTypeEnum::Relay muss 1 sein"); + static_assert(static_cast(::Buildings::EffectTypeEnum::BackgroundSound) == 2, + "EffectTypeEnum::BackgroundSound muss 2 sein"); + static_assert(static_cast(::Buildings::EffectTypeEnum::BsmFlash) == 3, + "EffectTypeEnum::BsmFlash muss 3 sein"); + EXPECT_TRUE(true); +} + +/** + * @test StateSetRelay muss mit den Werten aus bld_enums.idl generiert werden. + */ +TEST(bld_enums_Generated, StateSetRelayValues) +{ + static_assert(std::is_enum<::Buildings::StateSetRelay>::value, + "StateSetRelay muss aus bld_enums.hpp vorliegen"); + static_assert(static_cast(::Buildings::StateSetRelay::SwitchOff) == 0, + "StateSetRelay::SwitchOff muss 0 sein"); + static_assert(static_cast(::Buildings::StateSetRelay::SwitchOn) == 1, + "StateSetRelay::SwitchOn muss 1 sein"); + static_assert(static_cast(::Buildings::StateSetRelay::Pulse) == 2, + "StateSetRelay::Pulse muss 2 sein"); + static_assert(static_cast(::Buildings::StateSetRelay::GetState) == 3, + "StateSetRelay::GetState muss 3 sein"); + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden des generierten Headers ist erlaubt. + */ +TEST(bld_enums_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "Buildings/bld_enums.hpp" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_cod_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_cod_dtc.cpp index b964d12e6..5eea757cc 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_cod_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_cod_dtc.cpp @@ -1,16 +1,77 @@ /** * @file test_cod_dtc.cpp - * @brief Compilation test for CodificationManagement/cod_dtc.h + * @brief Verhaltenstests für die generierte CodificationManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus cod_service.xml + * generierten Header (Lts/Services/CodificationManagement/cod_dtc.h bzw. + * cod_ftc.h) aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus cod.hpp verifiziert, auf die + * der migrierte Code (object_codification_data.cpp, handler_codification_data.cpp) + * zugreift. */ #include "CodificationManagement/cod_dtc.h" +#include "CodificationManagement/cod_ftc.h" #include +#include +#include -TEST(cod_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(cod_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(cod_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(CodificationManagement::Interface::Dtc::identifier(), "CodificationManagement.Interface.Dtc"); + EXPECT_STREQ(CodificationManagement::Interface::Ftc::identifier(), "CodificationManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus cod.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * CodificationData (id, isUsed, identifier, partyId), die + * object_codification_data.cpp und handler_codification_data.cpp direkt + * als Felder nutzen. + */ +TEST(cod_dtc_Generated, CodificationDataHasPlainMembers) +{ + using CodificationData = CodificationManagement::CodificationData; + + static_assert(std::is_base_of<::Core::BaseEntity, CodificationData>::value, + "CodificationData muss von Core::BaseEntity abgeleitet sein (id/name/isUsed)"); + static_assert(std::is_same::value, + "id muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "isUsed muss ein plain bool-Member sein"); + static_assert(std::is_same::value, + "identifier muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "partyId muss ein plain int32_t-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(cod_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "CodificationManagement/cod_dtc.h" +#include "CodificationManagement/cod_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_evl_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_evl_dtc.cpp index a3b93949e..92a0118e8 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_evl_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_evl_dtc.cpp @@ -1,16 +1,90 @@ /** * @file test_evl_dtc.cpp - * @brief Compilation test for Evaluations/evl_dtc.h + * @brief Verhaltenstests für die generierte Evaluations Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus evl_service.xml + * generierten Header (Lts/Services/Evaluations/evl_dtc.h bzw. evl_ftc.h) + * aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus evl.hpp verifiziert, auf die + * der migrierte Code (handler_comment.cpp, handler_san_nine_liner.cpp, + * object_comment.cpp, object_san_nine_liner.cpp usw.) zugreift. */ #include "Evaluations/evl_dtc.h" +#include "Evaluations/evl_ftc.h" #include +#include +#include -TEST(evl_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(evl_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(evl_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(Evaluations::Interface::Dtc::identifier(), "Evaluations.Interface.Dtc"); + EXPECT_STREQ(Evaluations::Interface::Ftc::identifier(), "Evaluations.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus evl.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * EvaluationComment (optionaler receiverOperatorId, text), EvaluationCriterium + * und SanNineLiner (line1_position als GeoPosition2D mit plain lon/lat), die + * der migrierte Evaluations-Code direkt als Felder nutzt. + */ +TEST(evl_dtc_Generated, EvaluationTypesHavePlainMembers) +{ + using EvaluationComment = Evaluations::EvaluationComment; + using EvaluationCriterium = Evaluations::EvaluationCriterium; + using SanNineLiner = Evaluations::SanNineLiner; + + static_assert(std::is_same>::value, + "receiverOperatorId muss ein omg::types::optional-Member sein"); + static_assert(std::is_same::value, + "text muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "elementId muss ein plain int32_t-Member sein"); + + static_assert(std::is_same::value, + "EvaluationCriterium::name muss ein plain std::string-Member sein"); + + static_assert(std::is_same::value, + "line1_position muss ein plain Core::GeoPosition2D-Member sein"); + static_assert(std::is_same::value, + "lines muss ein plain std::string-Member sein"); + + // GeoPosition2D bringt plain lon/lat-Member mit (kein Getter/Setter mehr). + static_assert(std::is_same::value, + "GeoPosition2D::lon muss ein plain double-Member sein"); + static_assert(std::is_same::value, + "GeoPosition2D::lat muss ein plain double-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(evl_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "Evaluations/evl_dtc.h" +#include "Evaluations/evl_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_gim_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_gim_dtc.cpp index 14ae80c13..196465194 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_gim_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_gim_dtc.cpp @@ -1,16 +1,73 @@ /** * @file test_gim_dtc.cpp - * @brief Compilation test for GuezIedManagement/gim_dtc.h + * @brief Verhaltenstests für die generierte GuezIedManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus gim_service.xml + * generierten Header (Lts/Services/GuezIedManagement/gim_dtc.h bzw. gim_ftc.h) + * aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus gim.hpp verifiziert, auf die + * der migrierte Code (gim_dtc_impl_custom.cpp) zugreift. */ #include "GuezIedManagement/gim_dtc.h" +#include "GuezIedManagement/gim_ftc.h" #include +#include +#include -TEST(gim_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(gim_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(gim_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(GuezIedManagement::Interface::Dtc::identifier(), "GuezIedManagement.Interface.Dtc"); + EXPECT_STREQ(GuezIedManagement::Interface::Ftc::identifier(), "GuezIedManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus gim.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * Ied (equipmentNumber, type, symbol), die gim_dtc_impl_custom.cpp direkt + * als Felder nutzt (ied.equipmentNumber == equipmentNumber). + */ +TEST(gim_dtc_Generated, IedHasPlainMembers) +{ + using Ied = GuezIedManagement::Ied; + + static_assert(std::is_base_of<::Core::BaseEntityWithSampleTime, Ied>::value, + "Ied muss von Core::BaseEntityWithSampleTime abgeleitet sein"); + static_assert(std::is_same::value, + "equipmentNumber muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "type muss ein plain IedType-Member sein"); + static_assert(std::is_same::value, + "symbol muss ein plain std::string-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(gim_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "GuezIedManagement/gim_dtc.h" +#include "GuezIedManagement/gim_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_ism_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_ism_dtc.cpp index dc6973d5f..c99b9792e 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_ism_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_ism_dtc.cpp @@ -1,16 +1,92 @@ /** * @file test_ism_dtc.cpp - * @brief Compilation test for include/InfrastructureManagement/ism_dtc.h + * @brief Verhaltenstests für die generierte InfrastructureManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus ism_service.xml + * generierten Header (Lts/Services/InfrastructureManagement/ism_dtc.h bzw. + * ism_ftc.h) aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus ism.hpp verifiziert, auf die + * der migrierte Code (object_main_structure_element.cpp) zugreift. */ -#include "include/InfrastructureManagement/ism_dtc.h" +#include "InfrastructureManagement/ism_dtc.h" +#include "InfrastructureManagement/ism_ftc.h" #include +#include +#include -TEST(ism_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(ism_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(ism_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(InfrastructureManagement::Interface::Dtc::identifier(), "InfrastructureManagement.Interface.Dtc"); + EXPECT_STREQ(InfrastructureManagement::Interface::Ftc::identifier(), "InfrastructureManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus ism.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * MainStructureElement (geoPosition, elements) und StructureElement (path), + * die object_main_structure_element.cpp direkt als Felder nutzt. + */ +TEST(ism_dtc_Generated, StructureElementsHavePlainMembers) +{ + using MainStructureElement = InfrastructureManagement::MainStructureElement; + using StructureElement = InfrastructureManagement::StructureElement; + + static_assert(std::is_base_of<::Core::BaseEntity, MainStructureElement>::value, + "MainStructureElement muss von Core::BaseEntity abgeleitet sein (id/name/isUsed)"); + static_assert(std::is_same::value, + "structureElementId muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "geoPosition muss ein plain Core::GeoPosition-Member sein"); + static_assert(std::is_same>::value, + "elements muss eine omg::types::sequence sein"); + + static_assert(std::is_same::value, + "structureElementTypeId muss ein plain StructureElementType-Member sein"); + static_assert(std::is_same>::value, + "path muss eine omg::types::sequence sein"); + + // Core::GeoPosition bringt plain lon/lat/z-Member mit (kein Getter/Setter mehr). + static_assert(std::is_same::value, + "GeoPosition::lon muss ein plain double-Member sein"); + static_assert(std::is_same::value, + "GeoPosition::lat muss ein plain double-Member sein"); + static_assert(std::is_same::value, + "GeoPosition::z muss ein plain double-Member sein"); + + static_assert(std::is_enum<::InfrastructureManagement::StructureElementType>::value, + "StructureElementType muss aus ism_enums.hpp als Aufzählung vorliegen"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(ism_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "InfrastructureManagement/ism_dtc.h" +#include "InfrastructureManagement/ism_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_lts_coord_vector.cpp b/qt6-after/qt6-migrated-legatus/tests/test_lts_coord_vector.cpp index e3cb85786..b5f8cea5a 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_lts_coord_vector.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_lts_coord_vector.cpp @@ -1,13 +1,27 @@ #include -// Stub test for lts_coord_vector.cpp migration validation +// Compile-level regression test for the LtsCoordinate migration. +// +// lts_coord_vector.h includes the export header generated by +// NGL_ADD_LIBRARY2 for target LtsCoordinate as +// (same form as the qt5 legacy). +// The build-tree location (build4/Lts/Common/LtsCoordinate) is reachable +// for consumers via the PUBLIC binary-dir include of LtsCoordinate and of +// the sibling NGL_ADD_LIBRARY2 targets under Lts/Common. A bare quoted +// #include "ltscoordinate_export.h" only resolved inside the LtsCoordinate +// target itself and broke every consumer (svcIsmClient via +// ism_dtc_impl_custom_p.h), so this TU must keep including the header the +// same way consumers do. +#include -namespace Lts -{ -namespace Common -{ -} // namespace Common -} // namespace Lts +#ifndef LTSCOORDINATE_EXPORT +#error "ltscoordinate_export.h was not resolved; lts_coord_vector.h include regressed" +#endif + +#include + +static_assert(std::is_class::value, + "LtsCoordVector must be declared by lts_coord_vector.h"); TEST(lts_coord_vectorMigrationTest, CompilationStub) { diff --git a/qt6-after/qt6-migrated-legatus/tests/test_mdm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_mdm_dtc.cpp index 819c1b03b..c8c968ed7 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_mdm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_mdm_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_mdm_dtc.cpp - * @brief Compilation test for include/MeteoDataManagement/mdm_dtc.h + * @brief Compilation test for MeteoDataManagement/mdm_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/MeteoDataManagement/mdm_dtc.h" +#include "MeteoDataManagement/mdm_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_mrk_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_mrk_dtc.cpp index 8925834a3..88ea92d41 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_mrk_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_mrk_dtc.cpp @@ -1,16 +1,86 @@ /** * @file test_mrk_dtc.cpp - * @brief Compilation test for include/MarkerManagement/mrk_dtc.h + * @brief Verhaltenstests für die generierte MarkerManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus mrk_service.xml + * generierten Header (Lts/Services/MarkerManagement/mrk_dtc.h bzw. mrk_ftc.h) + * aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus mrk.hpp verifiziert, auf die + * der migrierte Code (object_marker.cpp, object_snapshot.cpp, handler_marker.cpp, + * handler_snapshot.cpp) zugreift. */ -#include "include/MarkerManagement/mrk_dtc.h" +#include "MarkerManagement/mrk_dtc.h" +#include "MarkerManagement/mrk_ftc.h" #include +#include +#include -TEST(mrk_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(mrk_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(mrk_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(MarkerManagement::Interface::Dtc::identifier(), "MarkerManagement.Interface.Dtc"); + EXPECT_STREQ(MarkerManagement::Interface::Ftc::identifier(), "MarkerManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus mrk.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * Marker (descriptions, position), MarkerDescription (markerType, content) + * und Snapshot, die der migrierte Marker/Snapshot-Code direkt als Felder nutzt. + */ +TEST(mrk_dtc_Generated, MarkerTypesHavePlainMembers) +{ + using Marker = MarkerManagement::Marker; + using MarkerDescription = MarkerManagement::MarkerDescription; + using Snapshot = MarkerManagement::Snapshot; + + static_assert(std::is_base_of<::Core::BaseEntity, Marker>::value, + "Marker muss von Core::BaseEntity abgeleitet sein (id/name/isUsed)"); + static_assert(std::is_same>::value, + "descriptions muss eine omg::types::sequence sein"); + static_assert(std::is_same::value, + "position muss ein plain Core::GeoPosition-Member sein"); + static_assert(std::is_same::value, + "isUsed muss ein plain bool-Member sein"); + + static_assert(std::is_same::value, + "markerType muss ein plain MarkerType-Member sein"); + static_assert(std::is_same::value, + "content muss ein plain std::string-Member sein"); + + static_assert(std::is_same::value, + "Snapshot::description muss ein plain std::string-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(mrk_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "MarkerManagement/mrk_dtc.h" +#include "MarkerManagement/mrk_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_msg_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_msg_dtc.cpp index 6662ccef6..c897a5318 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_msg_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_msg_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_msg_dtc.cpp - * @brief Compilation test for include/Messaging/msg_dtc.h + * @brief Compilation test for Messaging/msg_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/Messaging/msg_dtc.h" +#include "Messaging/msg_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_nom_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_nom_dtc.cpp index 12f16f037..d72fe031c 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_nom_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_nom_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_nom_dtc.cpp - * @brief Compilation test for include/NotificationManagement/nom_dtc.h + * @brief Compilation test for NotificationManagement/nom_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/NotificationManagement/nom_dtc.h" +#include "NotificationManagement/nom_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_opm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_opm_dtc.cpp index 3ffe9df55..5e98830fb 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_opm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_opm_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_opm_dtc.cpp - * @brief Compilation test for include/OperatorManagement/opm_dtc.h + * @brief Compilation test for OperatorManagement/opm_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/OperatorManagement/opm_dtc.h" +#include "OperatorManagement/opm_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_oss_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_oss_dtc.cpp index 4fb63e930..c8c724f3b 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_oss_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_oss_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_oss_dtc.cpp - * @brief Compilation test for include/OcSituationServer/oss_dtc.h + * @brief Compilation test for OcSituationServer/oss_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/OcSituationServer/oss_dtc.h" +#include "OcSituationServer/oss_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_pdm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_pdm_dtc.cpp index 4799f733a..332f89df2 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_pdm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_pdm_dtc.cpp @@ -1,16 +1,75 @@ /** * @file test_pdm_dtc.cpp - * @brief Compilation test for include/ProjectDataManagement/pdm_dtc.h + * @brief Verhaltenstests für die generierte ProjectDataManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus pdm_service.xml + * generierten Header (Lts/Services/ProjectDataManagement/pdm_dtc.h bzw. + * pdm_ftc.h) aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus pdm.hpp verifiziert, auf die + * der migrierte Code (pdm_dtc_impl_custom.cpp, translation.cpp) zugreift. */ -#include "Lts/Services/ProjectDataManagement/pdm_dtc.h" +#include "ProjectDataManagement/pdm_dtc.h" +#include "ProjectDataManagement/pdm_ftc.h" #include +#include +#include -TEST(pdm_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(pdm_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(pdm_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(ProjectDataManagement::Interface::Dtc::identifier(), "ProjectDataManagement.Interface.Dtc"); + EXPECT_STREQ(ProjectDataManagement::Interface::Ftc::identifier(), "ProjectDataManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus pdm.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * ChargeType (id, name, properties, legacyId), die pdm_dtc_impl_custom.cpp + * direkt als Felder nutzt (ct.id, ct.properties). + */ +TEST(pdm_dtc_Generated, ChargeTypeHasPlainMembers) +{ + using ChargeType = ProjectDataManagement::ChargeType; + + static_assert(std::is_base_of<::ProjectDataManagement::PdmBaseName, ChargeType>::value, + "ChargeType muss von PdmBaseName abgeleitet sein (id/name)"); + static_assert(std::is_same::value, + "id muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "name muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "properties muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "legacyId muss ein plain int32_t-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(pdm_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "ProjectDataManagement/pdm_dtc.h" +#include "ProjectDataManagement/pdm_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_ppm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_ppm_dtc.cpp index 333777b4d..bfc1809e2 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_ppm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_ppm_dtc.cpp @@ -1,16 +1,79 @@ /** * @file test_ppm_dtc.cpp - * @brief Compilation test for ParticipantManagement/ppm_dtc.h + * @brief Verhaltenstests für die generierte ParticipantManagement Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus ppm_service.xml + * generierten Header (Lts/Services/ParticipantManagement/ppm_dtc.h bzw. + * ppm_ftc.h) aus dem Build-Tree. Es darf keinen Stub-Header im Quellbaum geben. + * Zusätzlich werden die plainen DDS-Typ-Member aus ppm.hpp verifiziert, auf die + * der migrierte ParticipantManagement-Code zugreift. */ #include "ParticipantManagement/ppm_dtc.h" +#include "ParticipantManagement/ppm_ftc.h" #include +#include +#include -TEST(ppm_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(ppm_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Service-Namensschema folgen. + */ +TEST(ppm_dtc_Generated, IdentifiersMatchService) +{ + EXPECT_STREQ(ParticipantManagement::Interface::Dtc::identifier(), "ParticipantManagement.Interface.Dtc"); + EXPECT_STREQ(ParticipantManagement::Interface::Ftc::identifier(), "ParticipantManagement.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus ppm.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * ParticipantBase (id, name, equipmentNumber als optional) und Participant + * (inferiorIds als sequence), die der migrierte Code direkt als Felder nutzt. + */ +TEST(ppm_dtc_Generated, ParticipantTypesHavePlainMembers) +{ + using ParticipantBase = ParticipantManagement::ParticipantBase; + using Participant = ParticipantManagement::Participant; + + static_assert(std::is_same::value, + "id muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "name muss ein plain std::string-Member sein"); + static_assert(std::is_same>::value, + "equipmentNumber muss ein omg::types::optional-Member sein"); + + static_assert(std::is_base_of::value, + "Participant muss von ParticipantBase abgeleitet sein"); + static_assert(std::is_same>::value, + "inferiorIds muss eine omg::types::sequence sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(ppm_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "ParticipantManagement/ppm_dtc.h" +#include "ParticipantManagement/ppm_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_pre_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_pre_dtc.cpp index af65d1f1f..5470c4603 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_pre_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_pre_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_pre_dtc.cpp - * @brief Compilation test for include/PresentationManagement/pre_dtc.h + * @brief Compilation test for PresentationManagement/pre_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/PresentationManagement/pre_dtc.h" +#include "PresentationManagement/pre_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_rep_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_rep_dtc.cpp index 7d8cf551e..dd3fd07eb 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_rep_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_rep_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_rep_dtc.cpp - * @brief Compilation test for include/ReportManagement/rep_dtc.h + * @brief Compilation test for ReportManagement/rep_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/ReportManagement/rep_dtc.h" +#include "ReportManagement/rep_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_som_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_som_dtc.cpp index 6659eb261..823e67e55 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_som_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_som_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_som_dtc.cpp - * @brief Compilation test for include/SoundManagement/som_dtc.h + * @brief Compilation test for SoundManagement/som_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/SoundManagement/som_dtc.h" +#include "SoundManagement/som_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_srm_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_srm_dtc.cpp index d0be41d70..556860292 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_srm_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_srm_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_srm_dtc.cpp - * @brief Compilation test for include/SituationReplayManagement/srm_dtc.h + * @brief Compilation test for SituationReplayManagement/srm_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/SituationReplayManagement/srm_dtc.h" +#include "SituationReplayManagement/srm_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_srp_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_srp_dtc.cpp index d2807348f..1c4694719 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_srp_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_srp_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_srp_dtc.cpp - * @brief Compilation test for include/SituationReplay/srp_dtc.h + * @brief Compilation test for SituationReplay/srp_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/SituationReplay/srp_dtc.h" +#include "SituationReplay/srp_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_tab_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_tab_dtc.cpp index 35b07d8a9..124ad10c4 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_tab_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_tab_dtc.cpp @@ -1,16 +1,80 @@ /** * @file test_tab_dtc.cpp - * @brief Compilation test for include/TrainingAreaBase/tab_dtc.h + * @brief Verhaltenstests für die generierte TrainingAreaBase Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus der tab-XML + * generierten Header (Lts/Proxies/TrainingAreaBase/tab_dtc.h bzw. tab_ftc.h) + * aus dem Build-Tree. Der OFF-Stub include/TrainingAreaBase/tab_dtc.h wurde + * entfernt, da er den generierten Header verschattet hat. Zusätzlich werden + * die plainen DDS-Typ-Member aus tab.hpp verifiziert (EquipmentBase/BatteryAlarm), + * auf die die migrierten Proxy-Consumer zugreifen. */ -#include "include/TrainingAreaBase/tab_dtc.h" +#include "TrainingAreaBase/tab_dtc.h" +#include "TrainingAreaBase/tab_ftc.h" #include +#include +#include -TEST(tab_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(tab_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Proxy-Namensschema folgen. + */ +TEST(tab_dtc_Generated, IdentifiersMatchProxy) +{ + EXPECT_STREQ(TrainingAreaBase::Interface::Dtc::identifier(), "TrainingAreaBase.Interface.Dtc"); + EXPECT_STREQ(TrainingAreaBase::Interface::Ftc::identifier(), "TrainingAreaBase.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus tab.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * EquipmentBase (equipmentNumber/sampleTime) und der abgeleitete + * BatteryAlarm (batteryPort/description/acknowledge). + */ +TEST(tab_dtc_Generated, EquipmentTypesHavePlainMembers) +{ + using EquipmentBase = TrainingAreaBase::EquipmentBase; + using BatteryAlarm = TrainingAreaBase::BatteryAlarm; + + static_assert(std::is_same::value, + "equipmentNumber muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "sampleTime muss ein plain int64_t-Member sein"); + + static_assert(std::is_base_of::value, + "BatteryAlarm muss von EquipmentBase abgeleitet sein"); + static_assert(std::is_same::value, + "batteryPort muss ein plain int32_t-Member sein"); + static_assert(std::is_same::value, + "description muss ein plain std::string-Member sein"); + static_assert(std::is_same::value, + "acknowledge muss ein plain bool-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(tab_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "TrainingAreaBase/tab_dtc.h" +#include "TrainingAreaBase/tab_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_taboc_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_taboc_dtc.cpp index 8298d0067..2912895d0 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_taboc_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_taboc_dtc.cpp @@ -1,16 +1,74 @@ /** * @file test_taboc_dtc.cpp - * @brief Compilation test for include/DDS/taboc_dtc.h + * @brief Verhaltenstests für die generierte TrainingAreaBaseOC Dtc/Ftc-Schnittstelle * - * This test verifies that the migrated header compiles correctly with Qt6/C++23. + * Diese Tests prüfen den von CODEGEN_CLIENT_TOPICS_IFC aus der taboc-XML + * generierten Header (Lts/Proxies/TrainingAreaBaseOC/taboc_dtc.h bzw. + * taboc_ftc.h) aus dem Build-Tree. Der OFF-Stub include/TrainingAreaBaseOC/ + * taboc_dtc.h wurde entfernt, da er den generierten Header verschattet hat. + * Zusätzlich werden die plainen DDS-Typ-Member aus taboc.hpp verifiziert + * (OcEquipmentBase/CentralAesOverload), die taboc_dtc_impl.h direkt nutzt. */ #include "TrainingAreaBaseOC/taboc_dtc.h" +#include "TrainingAreaBaseOC/taboc_ftc.h" #include +#include +#include -TEST(taboc_dtc_Compilation, HeaderCompiles) +/** + * @test Der generierte Dtc muss von QObject abgeleitet sein (Signale für Topic-Updates); + * beide Schnittstellen sind abstrakt. + */ +TEST(taboc_dtc_Generated, DtcIsQObjectDerived) { - // This test verifies that the header compiles without errors + static_assert(std::is_base_of::value, + "generierter Dtc muss von QObject abgeleitet sein"); + static_assert(std::is_abstract::value, + "Dtc muss abstrakt sein"); + static_assert(std::is_abstract::value, + "Ftc muss abstrakt sein"); + EXPECT_TRUE(true); +} + +/** + * @test Die generierten Identifier müssen dem Proxy-Namensschema folgen. + */ +TEST(taboc_dtc_Generated, IdentifiersMatchProxy) +{ + EXPECT_STREQ(TrainingAreaBaseOC::Interface::Dtc::identifier(), "TrainingAreaBaseOC.Interface.Dtc"); + EXPECT_STREQ(TrainingAreaBaseOC::Interface::Ftc::identifier(), "TrainingAreaBaseOC.Interface.Ftc"); +} + +/** + * @test Die DDS-Typen aus taboc.hpp müssen plain-Member bereitstellen (rtiddsgen 7.7): + * OcEquipmentBase (id) und der abgeleitete CentralAesOverload (hasOverload), + * den taboc_dtc_impl.h als QMap-Wert verwendet. + */ +TEST(taboc_dtc_Generated, EquipmentTypesHavePlainMembers) +{ + using OcEquipmentBase = TrainingAreaBaseOC::OcEquipmentBase; + using CentralAesOverload = TrainingAreaBaseOC::CentralAesOverload; + + static_assert(std::is_same::value, + "id muss ein plain int32_t-Member sein"); + + static_assert(std::is_base_of::value, + "CentralAesOverload muss von OcEquipmentBase abgeleitet sein"); + static_assert(std::is_same::value, + "hasOverload muss ein plain bool-Member sein"); + + EXPECT_TRUE(true); +} + +/** + * @test Include-Guard: mehrfaches Einbinden der generierten Header ist erlaubt. + */ +TEST(taboc_dtc_Generated, MultipleIncludeGuard) +{ +// Including the header multiple times should not cause errors +#include "TrainingAreaBaseOC/taboc_dtc.h" +#include "TrainingAreaBaseOC/taboc_ftc.h" EXPECT_TRUE(true); } diff --git a/qt6-after/qt6-migrated-legatus/tests/test_tgt_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_tgt_dtc.cpp index 45c1f718d..a1d3405ec 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_tgt_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_tgt_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_tgt_dtc.cpp - * @brief Compilation test for include/TargetManagement/tgt_dtc.h + * @brief Compilation test for TargetManagement/tgt_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/TargetManagement/tgt_dtc.h" +#include "TargetManagement/tgt_dtc.h" #include diff --git a/qt6-after/qt6-migrated-legatus/tests/test_whg_dtc.cpp b/qt6-after/qt6-migrated-legatus/tests/test_whg_dtc.cpp index 527fde98a..c54be6205 100644 --- a/qt6-after/qt6-migrated-legatus/tests/test_whg_dtc.cpp +++ b/qt6-after/qt6-migrated-legatus/tests/test_whg_dtc.cpp @@ -1,11 +1,11 @@ /** * @file test_whg_dtc.cpp - * @brief Compilation test for include/WarehouseGuez/whg_dtc.h + * @brief Compilation test for WarehouseGuez/whg_dtc.h (generated) * * This test verifies that the migrated header compiles correctly with Qt6/C++23. */ -#include "include/WarehouseGuez/whg_dtc.h" +#include "WarehouseGuez/whg_dtc.h" #include