Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/tests/test_eventlist.cpp
T
torsten 950d669538 Qt6 Migration: BUILD_RTI guards und CMake fixes
- BUILD_RTI conditional compilation für RTI Connext DDS dependencies
- Namespace fixes in core_dtc.h (Core:: → DDS::Core::)
- CMakeLists.txt: BUILD_RTI option und conditional dependencies
- Handler minelayer: namespace closing mit BUILD_RTI guard
- Build erfolgreich mit BUILD_RTI=OFF validiert

Signed-off-by: Torsten Wierschin <torsten.wierschin@life-maps.com>
2026-08-21 18:37:18 +02:00

69 lines
2.0 KiB
C++

#include "Lts/Common/LtsTimelineClassic/Event.h"
#include "Lts/Common/LtsTimelineClassic/EventGraphic.h"
#include "Lts/Common/LtsTimelineClassic/EventList.h"
#include <gtest/gtest.h>
namespace LtsTimelineClassic
{
class EventListTest : public ::testing::Test
{
protected:
void SetUp() override {}
void TearDown() override {}
};
TEST(EventListTest, EventListTypedefWorks)
{
Event event1(0, 100, 0, 100, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::red, QJsonObject());
Event event2(50, 100, 50, 150, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::blue, QJsonObject());
EventList list;
list.append(&event1);
list.append(&event2);
EXPECT_EQ(list.size(), 2);
EXPECT_EQ(list[0], &event1);
EXPECT_EQ(list[1], &event2);
}
TEST(EventListTest, EventListIterationWorks)
{
Event event1(0, 100, 0, 100, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::red, QJsonObject());
Event event2(50, 100, 50, 150, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::blue, QJsonObject());
Event event3(100, 100, 100, 200, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::green, QJsonObject());
EventList list;
list.append(&event1);
list.append(&event2);
list.append(&event3);
int count = 0;
for (Event* event : list)
{
EXPECT_NE(event, nullptr);
count++;
}
EXPECT_EQ(count, 3);
}
TEST(EventListTest, EventGraphicListTypedefWorks)
{
Event event1(0, 100, 0, 100, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::red, QJsonObject());
Event event2(50, 100, 50, 150, 0, 0, 0, QStringList(), Event::EventPaintFunc(), Qt::blue, QJsonObject());
EventGraphic graphic1(&event1);
EventGraphic graphic2(&event2);
EventGraphicList graphicList;
graphicList.append(&graphic1);
graphicList.append(&graphic2);
EXPECT_EQ(graphicList.size(), 2);
EXPECT_EQ(graphicList[0], &graphic1);
EXPECT_EQ(graphicList[1], &graphic2);
}
} // namespace LtsTimelineClassic