M module-apps/application-calculator/tests/CalculatorUtility_tests.cpp => module-apps/application-calculator/tests/CalculatorUtility_tests.cpp +0 -9
@@ 8,15 8,6 @@
#include <cstring>
#include <vfs.hpp>
-class vfs vfs;
-
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_initializer;
TEST_CASE("Calculator utilities")
{
M module-bsp/board/rt1051/bsp/usb => module-bsp/board/rt1051/bsp/usb +1 -1
@@ 1,1 1,1 @@
-Subproject commit f82660330e5206735aa3c5b6fa7cfb3976eb3e48
+Subproject commit eb51f90b7cda303581e94d548c75bfbdda457df8
M module-db/tests/unittest.cpp => module-db/tests/unittest.cpp +0 -10
@@ 18,16 18,6 @@
#include <cstdio>
#include <cstring>
-class vfs vfs;
-
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_initializer;
-
TEST_CASE("Create and destroy simple database")
{
M module-gui/test/test-catch/test-gui.cpp => module-gui/test/test-catch/test-gui.cpp +0 -10
@@ 31,16 31,6 @@
using namespace std;
-class vfs vfs;
-
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_init;
-
TEST_CASE("Test BoundingBox intersect")
{
gui::BoundingBox result;
M module-services/service-db/test/test-service-db-settings-api.cpp => module-services/service-db/test/test-service-db-settings-api.cpp +0 -8
@@ 20,14 20,6 @@
#include "test-service-db-settings-testapps.hpp"
#include <vfs.hpp>
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_init;
-
TEST_CASE("SettingsApi")
{
SECTION("variable/profile/mode register/set/get/unregister")
M module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp => module-services/service-desktop/endpoints/update/UpdateEndpoint.cpp +17 -2
@@ 12,7 12,6 @@
#include <Service/Bus.hpp>
#include <json/json11.hpp>
#include <purefs/filesystem_paths.hpp>
-#include <vfs.hpp>
#include <filesystem>
#include <memory>
@@ 55,8 54,24 @@ auto UpdateEndpoint::run(Context &context) -> sys::ReturnCodes
auto UpdateEndpoint::getUpdates(Context &context) -> sys::ReturnCodes
{
const auto updatesOSPath = purefs::dir::getUpdatesOSPath();
- json11::Json fileList = vfs.listdir(updatesOSPath.c_str(), updateos::extension::update, true);
+ struct DirectoryEntry
+ {
+ std::string fileName;
+ uint32_t fileSize;
+ json11::Json to_json() const
+ {
+ return (json11::Json::object{{"name", fileName}, {"size", std::to_string(fileSize)}});
+ }
+ };
+ auto dirEntryVector = std::vector<DirectoryEntry>();
+ for (const auto &p : fs::directory_iterator(updatesOSPath)) {
+ if (!p.is_directory() && p.path().c_str() == updateos::extension::update) {
+ dirEntryVector.push_back(DirectoryEntry{p.path().string(), static_cast<uint32_t>(p.file_size())});
+ }
+ }
+
+ json11::Json fileList = dirEntryVector;
context.setResponseBody(json11::Json::object{{parserFSM::json::updateFileList, fileList}});
MessageHandler::putToSendQueue(context.createSimpleResponse());
M module-services/service-desktop/tests/unittest.cpp => module-services/service-desktop/tests/unittest.cpp +0 -9
@@ 27,15 27,6 @@
#include <string>
#include <vector>
-class vfs vfs;
-
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_initializer;
TEST_CASE("System Update Tests")
{
M module-utils/test/test_time_conversion.cpp => module-utils/test/test_time_conversion.cpp +0 -3
@@ 44,8 44,6 @@ class NullStream : public std::ostream
{}
};
-class vfs vfs;
-
using namespace utils::time;
using namespace std;
@@ 234,7 232,6 @@ int main(int argc, char *argv[])
{
time_t time_today = 0;
- vfs.Init();
// get reference Today time
if (bsp::rtc_GetCurrentTimestamp(&time_today)) {
std::cerr << "Error on gettime" << std::endl;
M module-utils/test/unittest_duration.cpp => module-utils/test/unittest_duration.cpp +0 -9
@@ 13,17 13,8 @@
#include <catch2/catch.hpp>
-class vfs vfs;
utils::i18n localize;
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_intializer;
-
TEST_CASE("Duration - creation")
{
utils::localize.setDisplayLanguage("English");
M module-utils/test/unittest_utils.cpp => module-utils/test/unittest_utils.cpp +0 -9
@@ 13,15 13,6 @@
#include "Utils.hpp"
#include <vfs.hpp>
-class vfs vfs;
-
-struct vfs_initializer
-{
- vfs_initializer()
- {
- vfs.Init();
- }
-} vfs_initializer;
TEST_CASE("Split tests")
{