Adds further migration results and moves generated tests in

This commit is contained in:
torsten committed 2026-08-19 21:21:59 +02:00
1 parent 19ab996be2
commit 72cbe318b6
442 files changed
+17126 -246

No files matched your search

@@ -0,0 +1,67 @@
#include "Lts/Common/LtsTimelineClassic/TimelineIndicator.h"
#include <QApplication>
#include <gtest/gtest.h>
namespace LtsTimelineClassic
{
class TimelineIndicatorTest : public ::testing::Test
{
protected:
void SetUp() override
{
int argc = 1;
char* argv[] = {const_cast<char*>("test")};
qApp = new QApplication(argc, argv);
}
void TearDown() override
{
delete qApp;
qApp = nullptr;
}
};
TEST(TimelineIndicatorTest, ConstructorCreatesValidIndicator)
{
QWidget parent;
TimelineIndicator indicator(&parent);
EXPECT_NO_THROW(indicator.update());
}
TEST(TimelineIndicatorTest, SlotZoomChangesIndex)
{
QWidget parent;
TimelineIndicator indicator(&parent);
int initialIndex = indicator.m_cbZoomLevel->currentIndex();
indicator.slotZoom();
// Zoom out should decrease index (if not already at 0)
if (initialIndex > 0)
{
EXPECT_EQ(indicator.m_cbZoomLevel->currentIndex(), initialIndex - 1);
}
else
{
EXPECT_EQ(indicator.m_cbZoomLevel->currentIndex(), 0);
}
}
TEST(TimelineIndicatorTest, SlotUnzoomChangesIndex)
{
QWidget parent;
TimelineIndicator indicator(&parent);
int initialIndex = indicator.m_cbZoomLevel->currentIndex();
int maxIndex = indicator.m_cbZoomLevel->count() - 1;
// Set to a lower index to allow unzoom
indicator.m_cbZoomLevel->setCurrentIndex(1);
indicator.slotUnzoom();
EXPECT_EQ(indicator.m_cbZoomLevel->currentIndex(), 2);
}
} // namespace LtsTimelineClassic