mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04: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()
|
||||
{
|
||||
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");
|
||||
|
||||
DatabaseWidget* dbWidget = m_tabWidget->currentDatabaseWidget();
|
||||
@ -148,13 +153,10 @@ void TestGui::testCreateDatabase()
|
||||
// there is a new empty db
|
||||
QCOMPARE(m_db->rootGroup()->children().size(), 0);
|
||||
|
||||
// clean
|
||||
// close the new database
|
||||
MessageBox::setNextAnswer(QMessageBox::No);
|
||||
triggerAction("actionDatabaseClose");
|
||||
Tools::wait(100);
|
||||
|
||||
QFile dbfile(QString(KEEPASSX_TEST_DATA_DIR).append("/NewTestDatabase.kdbx"));
|
||||
dbfile.remove();
|
||||
}
|
||||
|
||||
void TestGui::testMergeDatabase()
|
||||
|
Loading…
Reference in New Issue
Block a user