mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cloudstorage: adapt tests
The code assumes that prefs.cloud_base_url is non NULL. Allowing that to be NULL makes no sense during normal operation of the app. Yet, most of the tests don't initialize the prefs at all. Making things worse, if we do correctly initialize the prefs (so as to reasonably approximate the behavior when running the app), things break because some of the reference outputs assume that the prefs are unset. This deserves fixing. For now, simply make sure that cloud_base_url is set for all the tests that try to parse files. Additionally, the semantics how cloud_base_url is saved to disk have changed, so adjust the test for those prefs accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
cfe20ee5f4
commit
fe074ccad1
9 changed files with 32 additions and 0 deletions
|
@ -14,6 +14,23 @@
|
|||
// ..dives/exportprofilereference.csv) and copy the former over the later and commit that change
|
||||
// as well.
|
||||
|
||||
void TestProfile::init()
|
||||
{
|
||||
// Set UTF8 text codec as in real applications
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForMib(106));
|
||||
|
||||
// first, setup the preferences
|
||||
|
||||
// normally we should be able to do this - but it makes this test fail because the reference data
|
||||
// assume that the prefs are all 0 / false
|
||||
// copy_prefs(&default_prefs, &prefs);
|
||||
// instead we just set up the cloud_base_url to prevent parse_file() from crashing
|
||||
prefs.cloud_base_url = strdup(default_prefs.cloud_base_url);
|
||||
|
||||
QCoreApplication::setOrganizationName("Subsurface");
|
||||
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
|
||||
QCoreApplication::setApplicationName("Subsurface");
|
||||
}
|
||||
void TestProfile::testProfileExport()
|
||||
{
|
||||
prefs.planner_deco_mode = BUEHLMANN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue