68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
/**
|
|
* @file test_aes_enums.cpp
|
|
* @brief Tests für AreaEffectSimulation Enum-Header
|
|
*
|
|
* Diese Tests validieren dass die generierten DDS-Enum-Header korrekt kompilieren.
|
|
*/
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
// Include des zu testenden Headers
|
|
#include "AreaEffectSimulation/aes_enums.hpp"
|
|
|
|
/**
|
|
* @test Test dass der Header kompiliert und Enums existieren
|
|
*/
|
|
TEST(AesEnumsTest, HeaderCompilesAndEnumsExist)
|
|
{
|
|
// 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));
|
|
}
|
|
|
|
/**
|
|
* @test Test dass UnitSymbolPosition struct korrekt ist
|
|
*/
|
|
TEST(AesEnumsTest, UnitSymbolPositionStruct)
|
|
{
|
|
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);
|
|
}
|
|
|
|
/**
|
|
* @test Test dass Header mehrfach inkludierbar ist (include guard)
|
|
*/
|
|
TEST(AesEnumsTest, MultipleIncludeGuard)
|
|
{
|
|
// Including the header multiple times should not cause errors
|
|
// This is implicitly tested by including it again here
|
|
#include "AreaEffectSimulation/aes_enums.hpp"
|
|
|
|
// If we reach this point, the include guard works
|
|
EXPECT_TRUE(true);
|
|
} |