mirror of https://github.com/bitcoin/bitcoin
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:
parent
49cf63522e
commit
0dcbad341b
|
@ -85,13 +85,16 @@ int main(int argc, char* argv[])
|
||||||
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
|
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BitcoinApplication app;
|
|
||||||
app.setOrganizationName(QAPP_ORG_NAME);
|
QCoreApplication::setOrganizationName(QAPP_ORG_NAME);
|
||||||
app.setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
QCoreApplication::setApplicationName(QAPP_APP_NAME_DEFAULT "-test");
|
||||||
app.createNode(*init);
|
|
||||||
|
|
||||||
int num_test_failures{0};
|
int num_test_failures{0};
|
||||||
|
|
||||||
|
{
|
||||||
|
BitcoinApplication app;
|
||||||
|
app.createNode(*init);
|
||||||
|
|
||||||
AppTests app_tests(app);
|
AppTests app_tests(app);
|
||||||
num_test_failures += QTest::qExec(&app_tests);
|
num_test_failures += QTest::qExec(&app_tests);
|
||||||
|
|
||||||
|
@ -117,5 +120,10 @@ int main(int argc, char* argv[])
|
||||||
} else {
|
} else {
|
||||||
qDebug("\nAll tests passed.\n");
|
qDebug("\nAll tests passed.\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
settings.clear();
|
||||||
|
|
||||||
return num_test_failures;
|
return num_test_failures;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue