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
@@ -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