- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
70 lines
2.0 KiB
C++
70 lines
2.0 KiB
C++
#include "Lts/Common/LtsTimelineClassic/Event.h"
|
|
#include "Lts/Common/LtsTimelineClassic/TestTimelineModel.h"
|
|
|
|
#include <QtGui/QColor>
|
|
#include <QtCore/QJsonObject>
|
|
#include <QtCore/QStringList>
|
|
#include <gtest/gtest.h>
|
|
|
|
namespace LtsTimelineClassic
|
|
{
|
|
|
|
// Helper to create test Event with minimal parameters
|
|
static Event* createTestEvent()
|
|
{
|
|
return new Event(1, // uniqueId
|
|
1, // typeId
|
|
0, // startTime
|
|
1000, // endTime
|
|
1, // playerId
|
|
1, // partyId
|
|
1, // equipmentId
|
|
QStringList{"test"}, // path
|
|
Event::drawCustomEventGraphicRect, // paintFunc
|
|
QColor(Qt::red), // paintColor
|
|
QJsonObject()); // detailData
|
|
}
|
|
|
|
class TestTimelineModelTest : public ::testing::Test
|
|
{
|
|
protected:
|
|
void SetUp() override {}
|
|
|
|
void TearDown() override {}
|
|
};
|
|
|
|
TEST(TestTimelineModelTest, ConstructorCreatesValidModel)
|
|
{
|
|
TestTimelineModel model;
|
|
EXPECT_NO_THROW(model.rowCount());
|
|
EXPECT_NO_THROW(model.columnCount());
|
|
}
|
|
|
|
TEST(TestTimelineModelTest, AddTestEventIncreasesRowCount)
|
|
{
|
|
TestTimelineModel model;
|
|
int initialCount = model.rowCount();
|
|
|
|
Event* event = createTestEvent();
|
|
model.addTestEvent(event);
|
|
|
|
EXPECT_EQ(model.rowCount(), initialCount + 1);
|
|
}
|
|
|
|
TEST(TestTimelineModelTest, MultipleEventsCanBeAdded)
|
|
{
|
|
TestTimelineModel model;
|
|
int initialCount = model.rowCount();
|
|
|
|
Event* event1 = createTestEvent();
|
|
Event* event2 = createTestEvent();
|
|
Event* event3 = createTestEvent();
|
|
|
|
model.addTestEvent(event1);
|
|
model.addTestEvent(event2);
|
|
model.addTestEvent(event3);
|
|
|
|
EXPECT_EQ(model.rowCount(), initialCount + 3);
|
|
}
|
|
|
|
} // namespace LtsTimelineClassic
|