- Format MainWindow.cpp, MainWindow.h, main.cpp - Format test files (test_main.cpp, test_mainwindow.cpp) - Fixes Jenkins clang-format policy check Entire-Checkpoint: ea47c089bf3a Signed-off-by: twi-devel <torsten.wierschin@life-maps.com>
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#include "MainWindow.h"
|
|
|
|
#include <QApplication>
|
|
#include <QtTest/QtTest>
|
|
|
|
class TestMainWindowWidget : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
private slots:
|
|
void testMainWindowCreation();
|
|
void testWindowTitle();
|
|
void testValidateInputMethod();
|
|
void testGetScreenInfo();
|
|
};
|
|
|
|
void TestMainWindowWidget::testMainWindowCreation()
|
|
{
|
|
MainWindow window;
|
|
QVERIFY(!window.windowTitle().isEmpty());
|
|
}
|
|
|
|
void TestMainWindowWidget::testWindowTitle()
|
|
{
|
|
MainWindow window;
|
|
QCOMPARE(window.windowTitle(), u"Qt6 Legacy Migration Benchmark"_s);
|
|
}
|
|
|
|
void TestMainWindowWidget::testValidateInputMethod()
|
|
{
|
|
MainWindow window;
|
|
|
|
QVERIFY(window.validateInput(u"Test123"_s));
|
|
QVERIFY(window.validateInput(u"abc456"_s));
|
|
QVERIFY(!window.validateInput(u"123Test"_s));
|
|
QVERIFY(!window.validateInput(u""_s));
|
|
}
|
|
|
|
void TestMainWindowWidget::testGetScreenInfo()
|
|
{
|
|
MainWindow window;
|
|
QString info = window.getScreenInfo();
|
|
QVERIFY(!info.isEmpty());
|
|
QVERIFY(info.contains(u"Screen:"_s));
|
|
}
|
|
|
|
QTEST_MAIN(TestMainWindowWidget)
|
|
|
|
#include "test_mainwindow.moc" |