From 72bdd506f07d6a2cc9652efe0353a85d9b8e481a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 21 Jul 2021 13:32:28 -0700 Subject: [PATCH] tests: initialize our prefs to the default values Otherwise we end up with nonsensical values which lead to a division by zero, which in return leads to different results, depending on platform. Signed-off-by: Dirk Hohndel --- tests/testmerge.cpp | 2 +- tests/testparse.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testmerge.cpp b/tests/testmerge.cpp index 238044739..06d82e870 100644 --- a/tests/testmerge.cpp +++ b/tests/testmerge.cpp @@ -12,7 +12,7 @@ void TestMerge::initTestCase() { /* we need to manually tell that the resource exists, because we are using it as library. */ Q_INIT_RESOURCE(subsurface); - prefs.cloud_base_url = strdup(default_prefs.cloud_base_url); + copy_prefs(&default_prefs, &prefs); } void TestMerge::cleanup() diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 06eddaa8a..c3446712b 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -35,7 +35,7 @@ void TestParse::initTestCase() { /* we need to manually tell that the resource exists, because we are using it as library. */ Q_INIT_RESOURCE(subsurface); - prefs.cloud_base_url = strdup(default_prefs.cloud_base_url); + copy_prefs(&default_prefs, &prefs); } void TestParse::init()