From 10a2c379699cbb9783be27ff7b1fa30fbd38953c Mon Sep 17 00:00:00 2001 From: "Wiktor S. Ovalle Correa" Date: Tue, 20 Apr 2021 15:23:59 +0200 Subject: [PATCH] [EGD-3649] Fix paths in UT Reorganization of assets left path in UT outdated. --- module-db/tests/AlarmsRecord_tests.cpp | 4 ++-- module-db/tests/AlarmsTable_tests.cpp | 4 ++-- module-db/tests/CalllogRecord_tests.cpp | 6 +++--- module-db/tests/CalllogTable_tests.cpp | 4 ++-- module-db/tests/ContactGroups_tests.cpp | 2 +- module-db/tests/ContactsAddressTable_tests.cpp | 4 ++-- module-db/tests/ContactsNameTable_tests.cpp | 5 ++--- module-db/tests/ContactsNumberTable_tests.cpp | 4 ++-- module-db/tests/ContactsRecord_tests.cpp | 6 +++--- module-db/tests/ContactsRingtonesTable_tests.cpp | 4 ++-- module-db/tests/ContactsTable_tests.cpp | 4 ++-- module-db/tests/EventsRecord_tests.cpp | 2 +- module-db/tests/EventsTable_tests.cpp | 4 ++-- module-db/tests/NotesRecord_tests.cpp | 4 ++-- module-db/tests/NotesTable_tests.cpp | 2 +- module-db/tests/NotificationsRecord_tests.cpp | 4 ++-- module-db/tests/NotificationsTable_tests.cpp | 4 ++-- module-db/tests/QueryInterface.cpp | 4 ++-- module-db/tests/SMSRecord_tests.cpp | 6 +++--- module-db/tests/SMSTable_tests.cpp | 4 ++-- module-db/tests/SMSTemplateRecord_tests.cpp | 4 ++-- module-db/tests/SMSTemplateTable_tests.cpp | 4 ++-- module-db/tests/ThreadRecord_tests.cpp | 4 ++-- module-db/tests/ThreadsTable_tests.cpp | 4 ++-- module-gui/test/test-catch-text/test-gui-Font.cpp | 4 ++-- module-gui/test/test-catch-text/test-gui-Text.cpp | 2 +- module-gui/test/test-catch/test-gui.cpp | 4 ++-- module-gui/test/test-google/test-gui-dom-dump.cpp | 4 ++-- module-utils/i18n/i18n.cpp | 6 ++++++ module-utils/i18n/i18n.hpp | 5 +++-- module-utils/test/test_i18n.cpp | 8 ++++++++ 31 files changed, 72 insertions(+), 58 deletions(-) diff --git a/module-db/tests/AlarmsRecord_tests.cpp b/module-db/tests/AlarmsRecord_tests.cpp index de88d3a2c648c84f756aff76b86593dd94fdaa90..41f836a98b089f3e9cdcef7ddfb6e3740bb98403 100644 --- a/module-db/tests/AlarmsRecord_tests.cpp +++ b/module-db/tests/AlarmsRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -23,7 +23,7 @@ TEST_CASE("Alarms Record tests") { Database::initialize(); - const auto alarmsPath = (std::filesystem::path{"user"} / "alarms.db"); + const auto alarmsPath = (std::filesystem::path{"sys/user"} / "alarms.db"); if (std::filesystem::exists(alarmsPath)) { REQUIRE(std::filesystem::remove(alarmsPath)); } diff --git a/module-db/tests/AlarmsTable_tests.cpp b/module-db/tests/AlarmsTable_tests.cpp index c9078f7692b696f7fa26f74122192bf8565b76f9..f2d3d4681ea6aea5e3b0848cedd4aec66c19336c 100644 --- a/module-db/tests/AlarmsTable_tests.cpp +++ b/module-db/tests/AlarmsTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -18,7 +18,7 @@ TEST_CASE("Alarms Table tests") { Database::initialize(); - const auto alarmsPath = (std::filesystem::path{"user"} / "alarms.db"); + const auto alarmsPath = (std::filesystem::path{"sys/user"} / "alarms.db"); if (std::filesystem::exists(alarmsPath)) { REQUIRE(std::filesystem::remove(alarmsPath)); } diff --git a/module-db/tests/CalllogRecord_tests.cpp b/module-db/tests/CalllogRecord_tests.cpp index ecb16ec2a345bdd30c65ecfc597788a8b7f31dcd..abe910643f881642a6165a014e63fa16a0212a1d 100644 --- a/module-db/tests/CalllogRecord_tests.cpp +++ b/module-db/tests/CalllogRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -17,8 +17,8 @@ TEST_CASE("Calllog Record tests") { Database::initialize(); - const auto calllogPath = (std::filesystem::path{"user"} / "calllog.db"); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto calllogPath = (std::filesystem::path{"sys/user"} / "calllog.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(calllogPath)) { REQUIRE(std::filesystem::remove(calllogPath)); } diff --git a/module-db/tests/CalllogTable_tests.cpp b/module-db/tests/CalllogTable_tests.cpp index 1576f9d42b4df95c8950a93f2785c2c8211092a5..c311d93eb52ebd18a3ea461a2a4dd79f16f50129 100644 --- a/module-db/tests/CalllogTable_tests.cpp +++ b/module-db/tests/CalllogTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -17,7 +17,7 @@ TEST_CASE("Calllog Table tests") { Database::initialize(); - const auto calllogPath = (std::filesystem::path{"user"} / "calllog.db"); + const auto calllogPath = (std::filesystem::path{"sys/user"} / "calllog.db"); if (std::filesystem::exists(calllogPath)) { REQUIRE(std::filesystem::remove(calllogPath)); } diff --git a/module-db/tests/ContactGroups_tests.cpp b/module-db/tests/ContactGroups_tests.cpp index 5bbcadc88f06ac8df85b50fff0322aad3094c1fa..083aadf1ad3ffecc92811915b327796a574bec88 100644 --- a/module-db/tests/ContactGroups_tests.cpp +++ b/module-db/tests/ContactGroups_tests.cpp @@ -26,7 +26,7 @@ TEST_CASE("Contact Groups tests") { INFO("sqlite Init"); Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ContactsAddressTable_tests.cpp b/module-db/tests/ContactsAddressTable_tests.cpp index 05f9e73356bee347e9ca7bde892625c6b7e74adb..4552697c55aecefba65dbe2e7d53139dfdf10b81 100644 --- a/module-db/tests/ContactsAddressTable_tests.cpp +++ b/module-db/tests/ContactsAddressTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -10,7 +10,7 @@ TEST_CASE("Contacts address Table tests") { Database::initialize(); - const auto callogPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto callogPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(callogPath)) { REQUIRE(std::filesystem::remove(callogPath)); } diff --git a/module-db/tests/ContactsNameTable_tests.cpp b/module-db/tests/ContactsNameTable_tests.cpp index ed8c9dbaab17035da7c23c6f667ba4dbf515eca2..a50f70dc0889aca86105f34bca3327b587f094e2 100644 --- a/module-db/tests/ContactsNameTable_tests.cpp +++ b/module-db/tests/ContactsNameTable_tests.cpp @@ -1,7 +1,6 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md - #include #include "Database/Database.hpp" @@ -18,7 +17,7 @@ TEST_CASE("Contacts Name Table tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ContactsNumberTable_tests.cpp b/module-db/tests/ContactsNumberTable_tests.cpp index 63cbc77f9f58a3a02118903af615a0d0d91e184b..4b748d6e9660950dc5df00fcf8252f006a5dcc69 100644 --- a/module-db/tests/ContactsNumberTable_tests.cpp +++ b/module-db/tests/ContactsNumberTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -17,7 +17,7 @@ TEST_CASE("Contacts Number Table tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ContactsRecord_tests.cpp b/module-db/tests/ContactsRecord_tests.cpp index c155b462c828922afd1902d077f01d5f2f7f705d..0c5aa3fc8a28934cb32258354cada78445085b6d 100644 --- a/module-db/tests/ContactsRecord_tests.cpp +++ b/module-db/tests/ContactsRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -11,7 +11,7 @@ TEST_CASE("Contact Record db tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } @@ -262,7 +262,7 @@ TEST_CASE("Test converting contact data to string") TEST_CASE("Contact record numbers update") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ContactsRingtonesTable_tests.cpp b/module-db/tests/ContactsRingtonesTable_tests.cpp index 280bd4770fd46072598481a63cd94cdc4a1fc1f1..b2ee1ddab881c7da2a0aac8c65c6cd3ec181ffc7 100644 --- a/module-db/tests/ContactsRingtonesTable_tests.cpp +++ b/module-db/tests/ContactsRingtonesTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -17,7 +17,7 @@ TEST_CASE("Contacts Ringtones Table tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ContactsTable_tests.cpp b/module-db/tests/ContactsTable_tests.cpp index eb40f5257c44d82514f1db6dd5eb2f22daa34eda..b162db9f529114a5f1d1dc897f3a19bea3b220f1 100644 --- a/module-db/tests/ContactsTable_tests.cpp +++ b/module-db/tests/ContactsTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -11,7 +11,7 @@ TEST_CASE("Contacts Table tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/EventsRecord_tests.cpp b/module-db/tests/EventsRecord_tests.cpp index 208fcbaf3a7ead8114c74ae2360e50684c8f6281..0796801eb8a91f9b07493ee4652d6377089df719 100644 --- a/module-db/tests/EventsRecord_tests.cpp +++ b/module-db/tests/EventsRecord_tests.cpp @@ -39,7 +39,7 @@ TEST_CASE("Events Record tests") { Database::initialize(); - const auto eventsPath = (std::filesystem::path{"user"} / "events.db"); + const auto eventsPath = (std::filesystem::path{"sys/user"} / "events.db"); if (std::filesystem::exists(eventsPath)) { REQUIRE(std::filesystem::remove(eventsPath)); } diff --git a/module-db/tests/EventsTable_tests.cpp b/module-db/tests/EventsTable_tests.cpp index b32c8c09523cf447372e94ae2972790f7f225f44..6c0d6410a2a6d039c2e61f677e101917f9b9a723 100644 --- a/module-db/tests/EventsTable_tests.cpp +++ b/module-db/tests/EventsTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -32,7 +32,7 @@ TEST_CASE("Events Table tests") { Database::initialize(); - const auto eventsPath = (std::filesystem::path{"user"} / "events.db"); + const auto eventsPath = (std::filesystem::path{"sys/user"} / "events.db"); if (std::filesystem::exists(eventsPath)) { REQUIRE(std::filesystem::remove(eventsPath)); } diff --git a/module-db/tests/NotesRecord_tests.cpp b/module-db/tests/NotesRecord_tests.cpp index 36b7cf512c681d6a716a598c3c350f3011f92d45..bf3df385870f06059c9bec1706b396a96073f900 100644 --- a/module-db/tests/NotesRecord_tests.cpp +++ b/module-db/tests/NotesRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -17,7 +17,7 @@ TEST_CASE("Notes Record tests") { Database::initialize(); - const auto notesDbPath = std::filesystem::path{"user"} / "notes.db"; + const auto notesDbPath = std::filesystem::path{"sys/user"} / "notes.db"; NotesDB notesDb{notesDbPath.c_str()}; REQUIRE(notesDb.isInitialized()); diff --git a/module-db/tests/NotesTable_tests.cpp b/module-db/tests/NotesTable_tests.cpp index cc90bb23397ec3f54c249d940e7390e0f143af68..cbcb2534d9c3a1ca36fab4fe3129e64de7db8db4 100644 --- a/module-db/tests/NotesTable_tests.cpp +++ b/module-db/tests/NotesTable_tests.cpp @@ -12,7 +12,7 @@ TEST_CASE("Notes Table tests") { Database::initialize(); - const auto notesDbPath = std::filesystem::path{"user"} / "notes.db"; + const auto notesDbPath = std::filesystem::path{"sys/user"} / "notes.db"; NotesDB notesDb{notesDbPath.c_str()}; REQUIRE(notesDb.isInitialized()); diff --git a/module-db/tests/NotificationsRecord_tests.cpp b/module-db/tests/NotificationsRecord_tests.cpp index d0698522a07f914cfa8ed3feeb59d4087a6efe17..8626b3fc327ce41f68bc9aa019202a87d176cd53 100644 --- a/module-db/tests/NotificationsRecord_tests.cpp +++ b/module-db/tests/NotificationsRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -23,7 +23,7 @@ TEST_CASE("Notifications Record tests") { Database::initialize(); - const auto notificationsPath = (std::filesystem::path{"user"} / "notifications.db"); + const auto notificationsPath = (std::filesystem::path{"sys/user"} / "notifications.db"); if (std::filesystem::exists(notificationsPath)) { REQUIRE(std::filesystem::remove(notificationsPath)); } diff --git a/module-db/tests/NotificationsTable_tests.cpp b/module-db/tests/NotificationsTable_tests.cpp index 63a88f4254352a40adf87f5b57b4f6dc4ec293af..e071ce4ae08234e20d19e2383e4c9e736ce14495 100644 --- a/module-db/tests/NotificationsTable_tests.cpp +++ b/module-db/tests/NotificationsTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -18,7 +18,7 @@ TEST_CASE("Notifications Table tests") { Database::initialize(); - const auto notificationsPath = (std::filesystem::path{"user"} / "notifications.db"); + const auto notificationsPath = (std::filesystem::path{"sys/user"} / "notifications.db"); if (std::filesystem::exists(notificationsPath)) { REQUIRE(std::filesystem::remove(notificationsPath)); } diff --git a/module-db/tests/QueryInterface.cpp b/module-db/tests/QueryInterface.cpp index 249adff58411587d7c10c8c94036293ca0db3e53..27e1fd3f9bc5e471969edd634a0054f93aa500bf 100644 --- a/module-db/tests/QueryInterface.cpp +++ b/module-db/tests/QueryInterface.cpp @@ -39,8 +39,8 @@ TEST_CASE("Query interface") { Database::initialize(); - auto contactsDB = std::make_unique((std::filesystem::path{"user"} / "contacts.db").c_str()); - auto smsDB = std::make_unique((std::filesystem::path{"user"} / "sms.db").c_str()); + auto contactsDB = std::make_unique((std::filesystem::path{"sys/user"} / "contacts.db").c_str()); + auto smsDB = std::make_unique((std::filesystem::path{"sys/user"} / "sms.db").c_str()); auto smsInterface = std::make_unique(smsDB.get(), contactsDB.get()); auto threadInterface = std::make_unique(smsDB.get(), contactsDB.get()); diff --git a/module-db/tests/SMSRecord_tests.cpp b/module-db/tests/SMSRecord_tests.cpp index b693f06848737fdb667249d61152d7d9818a7e68..1302ca52738addbd02645b066535420624e1b690 100644 --- a/module-db/tests/SMSRecord_tests.cpp +++ b/module-db/tests/SMSRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -30,8 +30,8 @@ TEST_CASE("SMS Record tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/SMSTable_tests.cpp b/module-db/tests/SMSTable_tests.cpp index 69773dadfdd13132553eb0babdb841f388ae0953..b96f9fe39a4a4f14c80d4f726a183cbc963ecdee 100644 --- a/module-db/tests/SMSTable_tests.cpp +++ b/module-db/tests/SMSTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -15,7 +15,7 @@ TEST_CASE("SMS Table tests") { Database::initialize(); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(smsPath)) { REQUIRE(std::filesystem::remove(smsPath)); diff --git a/module-db/tests/SMSTemplateRecord_tests.cpp b/module-db/tests/SMSTemplateRecord_tests.cpp index 5d3d66e54c4acc55829b72e4dd17f2f014a107e3..27cc034c2b663b353fde0cd28409c726238ecd28 100644 --- a/module-db/tests/SMSTemplateRecord_tests.cpp +++ b/module-db/tests/SMSTemplateRecord_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -18,7 +18,7 @@ TEST_CASE("SMS templates Record tests") { Database::initialize(); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(smsPath)) { REQUIRE(std::filesystem::remove(smsPath)); } diff --git a/module-db/tests/SMSTemplateTable_tests.cpp b/module-db/tests/SMSTemplateTable_tests.cpp index 1d8beea1c68aef4dad805223383ba62c10cc21a9..54506161027ce1e0748f2e9685f4bfac067bddd8 100644 --- a/module-db/tests/SMSTemplateTable_tests.cpp +++ b/module-db/tests/SMSTemplateTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -19,7 +19,7 @@ TEST_CASE("SMS Templates Table tests") { Database::initialize(); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(smsPath)) { REQUIRE(std::filesystem::remove(smsPath)); } diff --git a/module-db/tests/ThreadRecord_tests.cpp b/module-db/tests/ThreadRecord_tests.cpp index 12be9dfe73cc2b7cd9ff225132ed45a7410cd249..a23312424a4d2b81e37557c72a28fe4e8b3c5263 100644 --- a/module-db/tests/ThreadRecord_tests.cpp +++ b/module-db/tests/ThreadRecord_tests.cpp @@ -28,8 +28,8 @@ TEST_CASE("Thread Record tests") { Database::initialize(); - const auto contactsPath = (std::filesystem::path{"user"} / "contacts.db"); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto contactsPath = (std::filesystem::path{"sys/user"} / "contacts.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(contactsPath)) { REQUIRE(std::filesystem::remove(contactsPath)); } diff --git a/module-db/tests/ThreadsTable_tests.cpp b/module-db/tests/ThreadsTable_tests.cpp index b86c458914e6635aa03a3b484af39fcc3f2da8b7..53305c3d2bdfcd589316efd9501a880efa302a13 100644 --- a/module-db/tests/ThreadsTable_tests.cpp +++ b/module-db/tests/ThreadsTable_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -18,7 +18,7 @@ TEST_CASE("Threads Table tests") { Database::initialize(); - const auto smsPath = (std::filesystem::path{"user"} / "sms.db"); + const auto smsPath = (std::filesystem::path{"sys/user"} / "sms.db"); if (std::filesystem::exists(smsPath)) { REQUIRE(std::filesystem::remove(smsPath)); } diff --git a/module-gui/test/test-catch-text/test-gui-Font.cpp b/module-gui/test/test-catch-text/test-gui-Font.cpp index 6aed39227510539b73ac0a7bd8c8e0e4195775ce..6f9702fbc2c5a4cec72b845720423d2600b9a548 100644 --- a/module-gui/test/test-catch-text/test-gui-Font.cpp +++ b/module-gui/test/test-catch-text/test-gui-Font.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include @@ -10,7 +10,7 @@ TEST_CASE("Testo Font") { using namespace gui; auto &fm = FontManager::getInstance(); - fm.init("assets"); + fm.init("sys/current/assets"); SECTION("medium font") { diff --git a/module-gui/test/test-catch-text/test-gui-Text.cpp b/module-gui/test/test-catch-text/test-gui-Text.cpp index 120f8708aee9dbf7bff1d36822274f50089b91f7..5dde620b88a4f326609196e707104fabb6b267ee 100644 --- a/module-gui/test/test-catch-text/test-gui-Text.cpp +++ b/module-gui/test/test-catch-text/test-gui-Text.cpp @@ -984,7 +984,7 @@ TEST_CASE("Text addition bounds - multiple limits tests") std::string testStringTwoLines = "Test String 1\nTest String 2"; std::string richTextTwoLines = - "Test String Test String 1

Test String 2"; SECTION("Adding text to lower limit set to signs count and size and lines on higher limit") diff --git a/module-gui/test/test-catch/test-gui.cpp b/module-gui/test/test-catch/test-gui.cpp index cb2dae21a9603ee7f604bc66e07498e311e3ce34..fef8e3c6296f6ab9b220afb4bc6cd5ee8b7fbf23 100644 --- a/module-gui/test/test-catch/test-gui.cpp +++ b/module-gui/test/test-catch/test-gui.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md /// These are random tests what could be salvaged from old tests @@ -55,7 +55,7 @@ TEST_CASE("Are fonts loaded") // this is because no fonts are loaded REQUIRE(fontmanager.getFont(0) == nullptr); // now initialize, from where is it taken? nobody knows from this foo - fontmanager.init("assets"); + fontmanager.init("sys/current/assets"); // check if there is at least default font REQUIRE(fontmanager.getFont(0) != nullptr); } diff --git a/module-gui/test/test-google/test-gui-dom-dump.cpp b/module-gui/test/test-google/test-gui-dom-dump.cpp index 7df74af69b27f6ab32cbae1ff64c165f35fc18a7..d442e638b5c6faf1e03cc0c7392f8b1aac3cc200 100644 --- a/module-gui/test/test-google/test-gui-dom-dump.cpp +++ b/module-gui/test/test-google/test-gui-dom-dump.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "gtest/gtest.h" @@ -21,7 +21,7 @@ class Item2JsonSerializerTester : public ::testing::Test Item2JsonSerializerTester() { auto &fm = gui::FontManager::getInstance(); - fm.init("assets"); + fm.init("sys/current/assets"); root.addWidget(new gui::Text(nullptr, 0, 0, 0, 0, testTextValue1)); root.addWidget(new gui::Label(nullptr, 0, 0, 0, 0, testTextValue2)); diff --git a/module-utils/i18n/i18n.cpp b/module-utils/i18n/i18n.cpp index 945fe7590461422e5216853aa2168bd5d8f73363..aa9225abc8869f7edcdc1570830e1c786a575f87 100644 --- a/module-utils/i18n/i18n.cpp +++ b/module-utils/i18n/i18n.cpp @@ -66,6 +66,12 @@ namespace utils return languageNames; } + void i18n::resetAssetsPath(const std::filesystem::path &assets) + { + DisplayLanguageDirPath = assets / "lang"; + InputLanguageDirPath = assets / "profiles"; + } + void i18n::setInputLanguage(const Language &lang) { if (lang.empty() || lang == inputLanguage) { diff --git a/module-utils/i18n/i18n.hpp b/module-utils/i18n/i18n.hpp index 05eda2a69f1dc92313ad8c82e2e8a25d3b87c2b0..fe8eb61f6ef1b29fd441cb4355990d6f7a1ece25 100644 --- a/module-utils/i18n/i18n.hpp +++ b/module-utils/i18n/i18n.hpp @@ -44,8 +44,9 @@ namespace utils public: static constexpr auto DefaultLanguage = "English"; - const std::filesystem::path DisplayLanguageDirPath = "assets/lang"; - const std::filesystem::path InputLanguageDirPath = "assets/profiles"; + std::filesystem::path DisplayLanguageDirPath = "assets/lang"; + std::filesystem::path InputLanguageDirPath = "assets/profiles"; + void resetAssetsPath(const std::filesystem::path &); virtual ~i18n() = default; void setInputLanguage(const Language &lang); diff --git a/module-utils/test/test_i18n.cpp b/module-utils/test/test_i18n.cpp index 3fb74dcf9a5ab455bad3078c6dd5411b5bfe41fa..b21663f19d4dc59b40b073f715f5bc5c2cc6da47 100644 --- a/module-utils/test/test_i18n.cpp +++ b/module-utils/test/test_i18n.cpp @@ -11,6 +11,7 @@ using namespace std; TEST_CASE("Test set display language - empty display language string") { + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -21,6 +22,7 @@ TEST_CASE("Test set display language - empty display language string") TEST_CASE("Test set display language - invalid display language string") { + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -31,6 +33,7 @@ TEST_CASE("Test set display language - invalid display language string") TEST_CASE("Test set display language - double invalid display language string") { + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -47,6 +50,7 @@ TEST_CASE("Test set display language - set display language with valid string") { static constexpr auto languageToChange = "Polski"; + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -59,6 +63,7 @@ TEST_CASE("Test set display language - set display language with valid string an { static constexpr auto languageToChange = "Polski"; + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -73,6 +78,7 @@ TEST_CASE("Test set display language - set display language with valid string an TEST_CASE("Test get string method - no display language set") { + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -82,6 +88,7 @@ TEST_CASE("Test get string method - no display language set") TEST_CASE("Test get string method - invalid display language set") { + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == ""); @@ -97,6 +104,7 @@ TEST_CASE("Test get string method - valid display language set") { static constexpr auto languageToChange = "Polski"; + utils::localize.resetAssetsPath("sys/current/assets"); utils::localize.resetDisplayLanguages(); REQUIRE(utils::localize.getDisplayLanguage() == "");