~aleteoryx/muditaos

92f028ddb66d22ad9936cecf3f34c5aa052faf65 — Radoslaw Wicik 4 years ago 3a28111
[EGD-6649] Fix SMS Record tests

Fix UT for WAL in SQLite.
1 files changed, 5 insertions(+), 8 deletions(-)

M module-db/tests/SMSRecord_tests.cpp
M module-db/tests/SMSRecord_tests.cpp => module-db/tests/SMSRecord_tests.cpp +5 -8
@@ 1,8 1,7 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <catch2/catch.hpp>

#include "common.hpp"
#include <Database/Database.hpp>
#include <Databases/ContactsDB.hpp>
#include <Databases/SmsDB.hpp>


@@ 13,6 12,8 @@
#include <country.hpp>
#include <PhoneNumber.hpp>

#include <catch2/catch.hpp>

#include <algorithm>
#include <filesystem>
#include <cstdint>


@@ 32,12 33,8 @@ TEST_CASE("SMS Record tests")

    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));
    }
    if (std::filesystem::exists(smsPath)) {
        REQUIRE(std::filesystem::remove(smsPath));
    }
    RemoveDbFiles(contactsPath.stem());
    RemoveDbFiles(smsPath.stem());

    ContactsDB contactsDB(contactsPath.c_str());
    SmsDB smsDB(smsPath.c_str());