diff --git a/module-db/tests/AlarmsRecord_tests.cpp b/module-db/tests/AlarmsRecord_tests.cpp index de88d3a2c..41f836a98 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 c9078f769..f2d3d4681 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 ecb16ec2a..abe910643 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 1576f9d42..c311d93eb 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 5bbcadc88..083aadf1a 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 05f9e7335..4552697c5 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 ed8c9dbaa..a50f70dc0 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 63cbc77f9..4b748d6e9 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 c155b462c..0c5aa3fc8 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 280bd4770..b2ee1ddab 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 eb40f5257..b162db9f5 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 208fcbaf3..0796801eb 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 b32c8c095..6c0d6410a 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 36b7cf512..bf3df3858 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 cc90bb233..cbcb2534d 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 d0698522a..8626b3fc3 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 63a88f425..e071ce4ae 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 249adff58..27e1fd3f9 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 b693f0684..1302ca527 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 69773dadf..b96f9fe39 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 5d3d66e54..27cc034c2 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 1d8beea1c..545061610 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 12be9dfe7..a23312424 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 b86c45891..53305c3d2 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 6aed39227..6f9702fbc 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 120f8708a..5dde620b8 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 cb2dae21a..fef8e3c62 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 7df74af69..d442e638b 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 945fe7590..aa9225abc 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 05eda2a69..fe8eb61f6 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 3fb74dcf9..b21663f19 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() == "");