Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/tests/test_aes_enums.cpp
berrux-dev e8d07af320 Adapts shared tests and common code to generated rtiddsgen API
Updates test suites and Lts/Common consumers to plain member access.
2026-09-21 02:44:07 +02:00

61 lines
2.8 KiB
C++

/**
* @file test_aes_enums.cpp
* @brief Verhaltenstests für die generierten AreaEffectSimulation-Enumerationen
*
* 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 "Lts/Services/AreaEffectSimulation/aes_enums.hpp"
#include <gtest/gtest.h>
#include <type_traits>
/**
* @test AesExplosionGeometry muss mit den Werten aus aes_enums.idl generiert werden.
*/
TEST(AesEnumsTest, ExplosionGeometryValues)
{
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 AesEffectState muss mit den Werten aus aes_enums.idl generiert werden.
*/
TEST(AesEnumsTest, EffectStateValues)
{
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 Include-Guard: mehrfaches Einbinden des generierten Headers ist erlaubt.
*/
TEST(AesEnumsTest, MultipleIncludeGuard)
{
// Including the header multiple times should not cause errors
// This is implicitly tested by including it again here
#include "Lts/Services/AreaEffectSimulation/aes_enums.hpp"
// If we reach this point, the include guard works
EXPECT_TRUE(true);
}