mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-13 00:09:54 -05:00
tests: gui: Fix NULL dereference in GUI tests
This commit is contained in:
parent
a02ddc773e
commit
0a516d526c
@ -354,8 +354,9 @@ void TestGui::testMergeDatabase()
|
|||||||
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/MergeDatabase.kdbx"));
|
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/MergeDatabase.kdbx"));
|
||||||
triggerAction("actionDatabaseMerge");
|
triggerAction("actionDatabaseMerge");
|
||||||
|
|
||||||
QTRY_COMPARE(QApplication::focusWidget()->objectName(), QString("passwordEdit"));
|
|
||||||
auto* editPasswordMerge = QApplication::focusWidget();
|
auto* editPasswordMerge = QApplication::focusWidget();
|
||||||
|
QVERIFY(editPasswordMerge);
|
||||||
|
QTRY_COMPARE(editPasswordMerge->objectName(), QString("passwordEdit"));
|
||||||
QVERIFY(editPasswordMerge->isVisible());
|
QVERIFY(editPasswordMerge->isVisible());
|
||||||
|
|
||||||
QTest::keyClicks(editPasswordMerge, "a");
|
QTest::keyClicks(editPasswordMerge, "a");
|
||||||
@ -457,8 +458,9 @@ void TestGui::testRemoteSyncDatabaseRequiresPassword()
|
|||||||
// need to process more events as opening with the same key did not work and more events have been fired
|
// need to process more events as opening with the same key did not work and more events have been fired
|
||||||
QApplication::processEvents(QEventLoop::WaitForMoreEvents);
|
QApplication::processEvents(QEventLoop::WaitForMoreEvents);
|
||||||
|
|
||||||
QTRY_COMPARE(QApplication::focusWidget()->objectName(), QString("passwordEdit"));
|
|
||||||
auto* editPasswordSync = QApplication::focusWidget();
|
auto* editPasswordSync = QApplication::focusWidget();
|
||||||
|
QVERIFY(editPasswordSync);
|
||||||
|
QTRY_COMPARE(editPasswordSync->objectName(), QString("passwordEdit"));
|
||||||
QVERIFY(editPasswordSync->isVisible());
|
QVERIFY(editPasswordSync->isVisible());
|
||||||
|
|
||||||
QTest::keyClicks(editPasswordSync, "b");
|
QTest::keyClicks(editPasswordSync, "b");
|
||||||
|
Loading…
Reference in New Issue
Block a user