mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
qt, test: Clean settings after tests
A test suite should not leave any artifacts except for those explicitly expected. This change is easy to review with `git diff --ignore-all-space` command.
This commit is contained in:
@@ -85,13 +85,16 @@ int main(int argc, char* argv[])
|
||||
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
|
||||
#endif
|
||||
|
||||
BitcoinApplication app;
|
||||
app.setOrganizationName(QAPP_ORG_NAME);
|
||||
app.setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
||||
app.createNode(*init);
|
||||
|
||||
QCoreApplication::setOrganizationName(QAPP_ORG_NAME);
|
||||
QCoreApplication::setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
||||
|
||||
int num_test_failures{0};
|
||||
|
||||
{
|
||||
BitcoinApplication app;
|
||||
app.createNode(*init);
|
||||
|
||||
AppTests app_tests(app);
|
||||
num_test_failures += QTest::qExec(&app_tests);
|
||||
|
||||
@@ -117,5 +120,10 @@ int main(int argc, char* argv[])
|
||||
} else {
|
||||
qDebug("\nAll tests passed.\n");
|
||||
}
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
settings.clear();
|
||||
|
||||
return num_test_failures;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user