mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
use QTemporaryFile when creating a database for guitest
This commit is contained in:
parent
c3c67f18b8
commit
d6e8e1be6e
@ -122,7 +122,12 @@ void TestGui::cleanup()
|
|||||||
|
|
||||||
void TestGui::testCreateDatabase()
|
void TestGui::testCreateDatabase()
|
||||||
{
|
{
|
||||||
fileDialog()->setNextFileName(QString(KEEPASSX_TEST_DATA_DIR).append("/NewTestDatabase.kdbx"));
|
QTemporaryFile tmpFile;
|
||||||
|
QVERIFY(tmpFile.open());
|
||||||
|
QString tmpFileName = tmpFile.fileName();
|
||||||
|
tmpFile.remove();
|
||||||
|
|
||||||
|
fileDialog()->setNextFileName(tmpFileName);
|
||||||
triggerAction("actionDatabaseNew");
|
triggerAction("actionDatabaseNew");
|
||||||
|
|
||||||
DatabaseWidget* dbWidget = m_tabWidget->currentDatabaseWidget();
|
DatabaseWidget* dbWidget = m_tabWidget->currentDatabaseWidget();
|
||||||
@ -148,13 +153,10 @@ void TestGui::testCreateDatabase()
|
|||||||
// there is a new empty db
|
// there is a new empty db
|
||||||
QCOMPARE(m_db->rootGroup()->children().size(), 0);
|
QCOMPARE(m_db->rootGroup()->children().size(), 0);
|
||||||
|
|
||||||
// clean
|
// close the new database
|
||||||
MessageBox::setNextAnswer(QMessageBox::No);
|
MessageBox::setNextAnswer(QMessageBox::No);
|
||||||
triggerAction("actionDatabaseClose");
|
triggerAction("actionDatabaseClose");
|
||||||
Tools::wait(100);
|
Tools::wait(100);
|
||||||
|
|
||||||
QFile dbfile(QString(KEEPASSX_TEST_DATA_DIR).append("/NewTestDatabase.kdbx"));
|
|
||||||
dbfile.remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestGui::testMergeDatabase()
|
void TestGui::testMergeDatabase()
|
||||||
|
Loading…
Reference in New Issue
Block a user