Adapts shared tests and common code to generated rtiddsgen API
Updates test suites and Lts/Common consumers to plain member access.
This commit is contained in:
41 files changed
+1076
-235
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<int64_t> = optional<qint64>` do not compile. Carry the generated type
|
||||
// separately, as the sequence<octet> 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<qint64>(");
|
||||
@@ -1039,7 +1046,7 @@ QVector<MemberInformation> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T>) is ambiguous for sequence<int64_t> members.
|
||||
QJsonValue toJson(long vec)
|
||||
{
|
||||
return QJsonValue(QString::number(vec));
|
||||
}
|
||||
template<>
|
||||
long fromJson(const QJsonValue &val, type<long>)
|
||||
{
|
||||
return val.toString().toLong();
|
||||
}
|
||||
|
||||
// std::string
|
||||
QJsonValue toJson(const std::string &element)
|
||||
|
||||
+23
-9
@@ -198,6 +198,17 @@ long long fromQVariant(const QVariant &val, type<long long>)
|
||||
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<int64_t>)
|
||||
{
|
||||
return static_cast<int64_t>(val.toLongLong());
|
||||
}
|
||||
|
||||
template<>
|
||||
double fromQVariant(const QVariant &val, type<double>)
|
||||
{
|
||||
@@ -555,7 +566,7 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
|
||||
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<QString, qint64>
|
||||
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<qint64>(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);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -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 <Common/PluginInterfaces/record_replay_plugin.h>
|
||||
|
||||
#include <LtsUtilsCore/pgarray.h>
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
// 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 <DDS/Generic/topic_type_plugin.h>
|
||||
|
||||
namespace {{ namespace }}
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltscoordinate_export.h"
|
||||
#include <LtsCoordinate/ltscoordinate_export.h>
|
||||
|
||||
#include <Core/core.hpp>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -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:
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltscoordinate_export.h"
|
||||
#include <LtsCoordinate/ltscoordinate_export.h>
|
||||
|
||||
#include <Core/core.hpp>
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
@@ -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<double(double, double, double, bool*)>;
|
||||
@@ -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:
|
||||
|
||||
@@ -293,7 +293,9 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
|
||||
}
|
||||
|
||||
const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended)
|
||||
const QVector<QStringRef> iidParameters = jsonIid.splitRef(QLatin1Char(':'));
|
||||
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split
|
||||
// provides the same zero-copy tokenization.
|
||||
const QList<QStringView> iidParameters = QStringView{jsonIid}.split(QLatin1Char(':'));
|
||||
|
||||
DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid;
|
||||
|
||||
|
||||
+6
-18
@@ -46,21 +46,15 @@ RequestHelper::RequestHelper(QObject* parent, bool quiet,
|
||||
}
|
||||
|
||||
void RequestHelper::addRequest(const std::function<int64_t()>& requestFunction,
|
||||
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler)
|
||||
const std::function<void(const Core::FunctionReply& baseReply)>& 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<int64_t()>& requestFunction,
|
||||
const std::function<void(const FunctionReplyType&)>& baseReplyHandler)
|
||||
const std::function<void(const Core::FunctionReply&)>& baseReplyHandler)
|
||||
{
|
||||
m_blockingCall = false;
|
||||
startSingleRequest(requestFunction, baseReplyHandler);
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
// Include des zu testenden Headers
|
||||
#include "AreaEffectSimulation/aes_dtc.h"
|
||||
#include "AreaEffectSimulation/aes_ftc.h"
|
||||
|
||||
/**
|
||||
* @test Test dass der Header kompiliert und Namespace existiert
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
// Include des zu testenden Headers
|
||||
#include "Lts/Services/AreaEffectSimulation/aes_enums.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <type_traits>
|
||||
|
||||
/**
|
||||
* @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<SymbolAppearance>(1));
|
||||
EXPECT_EQ(SymbolAppearance::Dotted, static_cast<SymbolAppearance>(2));
|
||||
EXPECT_EQ(SymbolVisibility::Hidden, static_cast<SymbolVisibility>(1));
|
||||
static_assert(std::is_enum<::AreaEffectSimulation::AesExplosionGeometry>::value,
|
||||
"AesExplosionGeometry muss aus aes_enums.hpp vorliegen");
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesExplosionGeometry::EgAimPoint), 0);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesExplosionGeometry::EgRadial), 1);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesExplosionGeometry::EgArea), 2);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesExplosionGeometry::EgLine), 3);
|
||||
EXPECT_EQ(static_cast<int>(::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<int>(::AreaEffectSimulation::AesEffectState::EsUnknown), 0);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsExpired), 1);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsRemoved), 2);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsCreated), 4);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsPrepared), 5);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsActivated), 6);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsPaused), 7);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsReceived), 8);
|
||||
EXPECT_EQ(static_cast<int>(::AreaEffectSimulation::AesEffectState::EsFired), 9);
|
||||
EXPECT_EQ(static_cast<int>(::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);
|
||||
}
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
// Include the stub header - this test ensures it compiles
|
||||
#include "AlarmManagement/alm_dtc.h"
|
||||
#include "AlarmManagement/alm_ftc.h"
|
||||
|
||||
TEST(AlarmManagementDtc, HeaderCompiles)
|
||||
{
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include "AssetManagement/asm_dtc.h"
|
||||
#include "AssetManagement/asm_ftc.h"
|
||||
|
||||
// Test that the header compiles and provides expected forward declarations
|
||||
TEST(AsmDtcTest, HeaderCompilesSuccessfully)
|
||||
#include <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
/**
|
||||
* @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<QObject, AssetManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<AssetManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<AssetManagement::Interface::Ftc>::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));
|
||||
}
|
||||
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<decltype(Asset{}.id), int32_t>::value,
|
||||
"id muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(Asset{}.name), std::string>::value,
|
||||
"name muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(Asset{}.assetTypeId), ::AssetManagement::AssetType>::value,
|
||||
"assetTypeId muss ein plain AssetType-Member sein");
|
||||
static_assert(std::is_same<decltype(Asset{}.locationId), int32_t>::value,
|
||||
"locationId muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(Asset{}.subLocation), int32_t>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <type_traits>
|
||||
|
||||
TEST(AsmEnumsTest, SymbolAppearanceEnumValues)
|
||||
/**
|
||||
* @test MapType muss mit den Werten aus asm_enums.idl generiert werden.
|
||||
*/
|
||||
TEST(AsmEnumsTest, MapTypeValues)
|
||||
{
|
||||
EXPECT_EQ(static_cast<int>(AssetManagement::SymbolAppearance::Solid), 0);
|
||||
EXPECT_EQ(static_cast<int>(AssetManagement::SymbolAppearance::Dashed), 1);
|
||||
EXPECT_EQ(static_cast<int>(AssetManagement::SymbolAppearance::Dotted), 2);
|
||||
static_assert(std::is_enum<::AssetManagement::MapType>::value,
|
||||
"MapType muss aus asm_enums.hpp vorliegen");
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::MapType::Unknown), 0);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::MapType::Topographic), 1);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::MapType::Aerial), 2);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::MapType::Feature), 3);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::MapType::Elevation), 4);
|
||||
EXPECT_EQ(static_cast<int>(::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<int>(AssetManagement::SymbolVisibility::Visible), 0);
|
||||
EXPECT_EQ(static_cast<int>(AssetManagement::SymbolVisibility::Hidden), 1);
|
||||
static_assert(std::is_enum<::AssetManagement::ShutdownAction>::value,
|
||||
"ShutdownAction muss aus asm_enums.hpp vorliegen");
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::ShutdownAction::NoAction), 0);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::ShutdownAction::Logout), 1);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::ShutdownAction::Shutdown), 2);
|
||||
EXPECT_EQ(static_cast<int>(::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);
|
||||
}
|
||||
static_assert(std::is_enum<::AssetManagement::AssetType>::value,
|
||||
"AssetType muss aus asm_enums.hpp vorliegen");
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::Unknown), 0);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::Workstation), 1);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::Printer), 2);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::Beamer), 3);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::ProjectionWorkstation), 4);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::MobileAfterActionVehicle), 5);
|
||||
EXPECT_EQ(static_cast<int>(::AssetManagement::AssetType::AdlerSAA), 6);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, Buildings::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<Buildings::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<Buildings::Interface::Ftc>::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<decltype(SwitchRelayRequest{}.buildingId), int32_t>::value,
|
||||
"buildingId muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(SwitchRelayRequest{}.assetId), int32_t>::value,
|
||||
"assetId muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(SwitchRelayRequest{}.state), ::Buildings::StateSetRelay>::value,
|
||||
"state muss ein plain Buildings::StateSetRelay-Member sein");
|
||||
static_assert(std::is_same<decltype(SwitchRelayRequest{}.number), int32_t>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <type_traits>
|
||||
|
||||
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<int32_t>(::Buildings::EffectTypeEnum::Undefined) == 0,
|
||||
"EffectTypeEnum::Undefined muss 0 sein");
|
||||
static_assert(static_cast<int32_t>(::Buildings::EffectTypeEnum::Relay) == 1,
|
||||
"EffectTypeEnum::Relay muss 1 sein");
|
||||
static_assert(static_cast<int32_t>(::Buildings::EffectTypeEnum::BackgroundSound) == 2,
|
||||
"EffectTypeEnum::BackgroundSound muss 2 sein");
|
||||
static_assert(static_cast<int32_t>(::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<int32_t>(::Buildings::StateSetRelay::SwitchOff) == 0,
|
||||
"StateSetRelay::SwitchOff muss 0 sein");
|
||||
static_assert(static_cast<int32_t>(::Buildings::StateSetRelay::SwitchOn) == 1,
|
||||
"StateSetRelay::SwitchOn muss 1 sein");
|
||||
static_assert(static_cast<int32_t>(::Buildings::StateSetRelay::Pulse) == 2,
|
||||
"StateSetRelay::Pulse muss 2 sein");
|
||||
static_assert(static_cast<int32_t>(::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, CodificationManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<CodificationManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<CodificationManagement::Interface::Ftc>::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<decltype(CodificationData{}.id), int32_t>::value,
|
||||
"id muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(CodificationData{}.isUsed), bool>::value,
|
||||
"isUsed muss ein plain bool-Member sein");
|
||||
static_assert(std::is_same<decltype(CodificationData{}.identifier), std::string>::value,
|
||||
"identifier muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(CodificationData{}.partyId), int32_t>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, Evaluations::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<Evaluations::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<Evaluations::Interface::Ftc>::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<decltype(EvaluationComment{}.receiverOperatorId),
|
||||
::omg::types::optional<int32_t>>::value,
|
||||
"receiverOperatorId muss ein omg::types::optional<int32_t>-Member sein");
|
||||
static_assert(std::is_same<decltype(EvaluationComment{}.text), std::string>::value,
|
||||
"text muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(EvaluationComment{}.elementId), int32_t>::value,
|
||||
"elementId muss ein plain int32_t-Member sein");
|
||||
|
||||
static_assert(std::is_same<decltype(EvaluationCriterium{}.name), std::string>::value,
|
||||
"EvaluationCriterium::name muss ein plain std::string-Member sein");
|
||||
|
||||
static_assert(std::is_same<decltype(SanNineLiner{}.line1_position), ::Core::GeoPosition2D>::value,
|
||||
"line1_position muss ein plain Core::GeoPosition2D-Member sein");
|
||||
static_assert(std::is_same<decltype(SanNineLiner{}.lines), std::string>::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<decltype(::Core::GeoPosition2D{}.lon), double>::value,
|
||||
"GeoPosition2D::lon muss ein plain double-Member sein");
|
||||
static_assert(std::is_same<decltype(::Core::GeoPosition2D{}.lat), double>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, GuezIedManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<GuezIedManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<GuezIedManagement::Interface::Ftc>::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<decltype(Ied{}.equipmentNumber), int32_t>::value,
|
||||
"equipmentNumber muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(Ied{}.type), ::GuezIedManagement::IedType>::value,
|
||||
"type muss ein plain IedType-Member sein");
|
||||
static_assert(std::is_same<decltype(Ied{}.symbol), std::string>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, InfrastructureManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<InfrastructureManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<InfrastructureManagement::Interface::Ftc>::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<decltype(MainStructureElement{}.structureElementId), int32_t>::value,
|
||||
"structureElementId muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(MainStructureElement{}.geoPosition), ::Core::GeoPosition>::value,
|
||||
"geoPosition muss ein plain Core::GeoPosition-Member sein");
|
||||
static_assert(std::is_same<decltype(MainStructureElement{}.elements),
|
||||
::omg::types::sequence<::InfrastructureManagement::StructureElement>>::value,
|
||||
"elements muss eine omg::types::sequence<StructureElement> sein");
|
||||
|
||||
static_assert(std::is_same<decltype(StructureElement{}.structureElementTypeId),
|
||||
::InfrastructureManagement::StructureElementType>::value,
|
||||
"structureElementTypeId muss ein plain StructureElementType-Member sein");
|
||||
static_assert(std::is_same<decltype(StructureElement{}.path), ::omg::types::sequence<int32_t>>::value,
|
||||
"path muss eine omg::types::sequence<int32_t> sein");
|
||||
|
||||
// Core::GeoPosition bringt plain lon/lat/z-Member mit (kein Getter/Setter mehr).
|
||||
static_assert(std::is_same<decltype(::Core::GeoPosition{}.lon), double>::value,
|
||||
"GeoPosition::lon muss ein plain double-Member sein");
|
||||
static_assert(std::is_same<decltype(::Core::GeoPosition{}.lat), double>::value,
|
||||
"GeoPosition::lat muss ein plain double-Member sein");
|
||||
static_assert(std::is_same<decltype(::Core::GeoPosition{}.z), double>::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);
|
||||
}
|
||||
@@ -1,13 +1,27 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
// 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
|
||||
// <LtsCoordinate/ltscoordinate_export.h> (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 <LtsCoordinate/lts_coord_vector.h>
|
||||
|
||||
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 <type_traits>
|
||||
|
||||
static_assert(std::is_class<LtsCoordTrans::LtsCoordVector>::value,
|
||||
"LtsCoordVector must be declared by lts_coord_vector.h");
|
||||
|
||||
TEST(lts_coord_vectorMigrationTest, CompilationStub)
|
||||
{
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, MarkerManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<MarkerManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<MarkerManagement::Interface::Ftc>::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<decltype(Marker{}.descriptions),
|
||||
::omg::types::sequence<::MarkerManagement::MarkerDescription>>::value,
|
||||
"descriptions muss eine omg::types::sequence<MarkerDescription> sein");
|
||||
static_assert(std::is_same<decltype(Marker{}.position), ::Core::GeoPosition>::value,
|
||||
"position muss ein plain Core::GeoPosition-Member sein");
|
||||
static_assert(std::is_same<decltype(Marker{}.isUsed), bool>::value,
|
||||
"isUsed muss ein plain bool-Member sein");
|
||||
|
||||
static_assert(std::is_same<decltype(MarkerDescription{}.markerType),
|
||||
::MarkerManagement::MarkerType>::value,
|
||||
"markerType muss ein plain MarkerType-Member sein");
|
||||
static_assert(std::is_same<decltype(MarkerDescription{}.content), std::string>::value,
|
||||
"content muss ein plain std::string-Member sein");
|
||||
|
||||
static_assert(std::is_same<decltype(Snapshot{}.description), std::string>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, ProjectDataManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<ProjectDataManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<ProjectDataManagement::Interface::Ftc>::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<decltype(ChargeType{}.id), int32_t>::value,
|
||||
"id muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(ChargeType{}.name), std::string>::value,
|
||||
"name muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(ChargeType{}.properties), std::string>::value,
|
||||
"properties muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(ChargeType{}.legacyId), int32_t>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, ParticipantManagement::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<ParticipantManagement::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<ParticipantManagement::Interface::Ftc>::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<decltype(ParticipantBase{}.id), int32_t>::value,
|
||||
"id muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(ParticipantBase{}.name), std::string>::value,
|
||||
"name muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(ParticipantBase{}.equipmentNumber),
|
||||
::omg::types::optional<int32_t>>::value,
|
||||
"equipmentNumber muss ein omg::types::optional<int32_t>-Member sein");
|
||||
|
||||
static_assert(std::is_base_of<ParticipantBase, Participant>::value,
|
||||
"Participant muss von ParticipantBase abgeleitet sein");
|
||||
static_assert(std::is_same<decltype(Participant{}.inferiorIds),
|
||||
::omg::types::sequence<int32_t>>::value,
|
||||
"inferiorIds muss eine omg::types::sequence<int32_t> 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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, TrainingAreaBase::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<TrainingAreaBase::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<TrainingAreaBase::Interface::Ftc>::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<decltype(EquipmentBase{}.equipmentNumber), int32_t>::value,
|
||||
"equipmentNumber muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(EquipmentBase{}.sampleTime), int64_t>::value,
|
||||
"sampleTime muss ein plain int64_t-Member sein");
|
||||
|
||||
static_assert(std::is_base_of<EquipmentBase, BatteryAlarm>::value,
|
||||
"BatteryAlarm muss von EquipmentBase abgeleitet sein");
|
||||
static_assert(std::is_same<decltype(BatteryAlarm{}.batteryPort), int32_t>::value,
|
||||
"batteryPort muss ein plain int32_t-Member sein");
|
||||
static_assert(std::is_same<decltype(BatteryAlarm{}.description), std::string>::value,
|
||||
"description muss ein plain std::string-Member sein");
|
||||
static_assert(std::is_same<decltype(BatteryAlarm{}.acknowledge), bool>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
#include <QObject>
|
||||
#include <type_traits>
|
||||
|
||||
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<QObject, TrainingAreaBaseOC::Interface::Dtc>::value,
|
||||
"generierter Dtc muss von QObject abgeleitet sein");
|
||||
static_assert(std::is_abstract<TrainingAreaBaseOC::Interface::Dtc>::value,
|
||||
"Dtc muss abstrakt sein");
|
||||
static_assert(std::is_abstract<TrainingAreaBaseOC::Interface::Ftc>::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<decltype(OcEquipmentBase{}.id), int32_t>::value,
|
||||
"id muss ein plain int32_t-Member sein");
|
||||
|
||||
static_assert(std::is_base_of<OcEquipmentBase, CentralAesOverload>::value,
|
||||
"CentralAesOverload muss von OcEquipmentBase abgeleitet sein");
|
||||
static_assert(std::is_same<decltype(CentralAesOverload{}.hasOverload), bool>::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);
|
||||
}
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
@@ -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 <gtest/gtest.h>
|
||||
|
||||
|
||||
Reference in new issue
Block a user