M module-db/Interface/CalllogRecord.cpp => module-db/Interface/CalllogRecord.cpp +2 -2
@@ 82,7 82,7 @@ bool CalllogRecordInterface::Add(const CalllogRecord &rec)
LOG_DEBUG("Adding private call entry to call log record.");
}
- return calllogDB->calls.add(CalllogTableRow{{.ID = localRec.ID}, // this is only to remove warning
+ return calllogDB->calls.add(CalllogTableRow{Record(localRec.ID), // this is only to remove warning
.number = localRec.phoneNumber.getEntered(),
.e164number = localRec.phoneNumber.getE164(),
.presentation = localRec.presentation,
@@ 161,7 161,7 @@ bool CalllogRecordInterface::Update(const CalllogRecord &rec)
}
}
- return calllogDB->calls.update(CalllogTableRow{{.ID = rec.ID},
+ return calllogDB->calls.update(CalllogTableRow{Record(rec.ID),
.number = rec.phoneNumber.getEntered(),
.e164number = rec.phoneNumber.getE164(),
.presentation = presentation,
M module-db/Interface/ContactRecord.cpp => module-db/Interface/ContactRecord.cpp +18 -18
@@ 30,7 30,7 @@ ContactRecordInterface::ContactRecordInterface(ContactsDB *db)
auto ContactRecordInterface::Add(ContactRecord &rec) -> bool
{
bool ret = contactDB->contacts.add(
- ContactsTableRow{{.ID = DB_ID_NONE}, .speedDial = rec.speeddial, .namePrimary = rec.primaryName});
+ ContactsTableRow{Record(DB_ID_NONE), .speedDial = rec.speeddial, .namePrimary = rec.primaryName});
if (!ret) {
return false;
@@ 40,7 40,7 @@ auto ContactRecordInterface::Add(ContactRecord &rec) -> bool
debug_db_data("New contact with ID %" PRIu32 " created", contactID);
rec.ID = contactID;
- ret = contactDB->name.add(ContactsNameTableRow{{.ID = DB_ID_NONE},
+ ret = contactDB->name.add(ContactsNameTableRow{Record(DB_ID_NONE),
.contactID = contactID,
.namePrimary = rec.primaryName,
.nameAlternative = rec.alternativeName});
@@ 54,7 54,7 @@ auto ContactRecordInterface::Add(ContactRecord &rec) -> bool
// build string list of number IDs
std::string numbersIDs;
for (auto a : rec.numbers) {
- ret = contactDB->number.add(ContactsNumberTableRow{{.ID = DB_ID_NONE},
+ ret = contactDB->number.add(ContactsNumberTableRow{Record(DB_ID_NONE),
.contactID = contactID,
.numberUser = a.number.getEntered().c_str(),
.numbere164 = a.number.getE164().c_str(),
@@ 80,7 80,7 @@ auto ContactRecordInterface::Add(ContactRecord &rec) -> bool
auto contactRingID = contactDB->getLastInsertRowId();
ret = contactDB->address.add(ContactsAddressTableRow{
- {.ID = DB_ID_NONE}, .contactID = contactID, .address = rec.address, .note = rec.note, .mail = rec.mail});
+ Record(DB_ID_NONE), .contactID = contactID, .address = rec.address, .note = rec.note, .mail = rec.mail});
if (!ret) {
return false;
@@ 88,7 88,7 @@ auto ContactRecordInterface::Add(ContactRecord &rec) -> bool
auto contactAddressID = contactDB->getLastInsertRowId();
- ret = contactDB->contacts.update(ContactsTableRow{{.ID = contactID},
+ ret = contactDB->contacts.update(ContactsTableRow{Record(contactID),
.nameID = contactNameID,
.numbersID = numbersIDs,
.ringID = contactRingID,
@@ 432,7 432,7 @@ auto ContactRecordInterface::Update(const ContactRecord &rec) -> bool
auto numberMatch =
numberMatcher.bestMatch(utils::PhoneNumber(number.number), utils::PhoneNumber::Match::POSSIBLE);
if (numberMatch == numberMatcher.END) {
- if (!contactDB->number.add(ContactsNumberTableRow{{.ID = DB_ID_NONE},
+ if (!contactDB->number.add(ContactsNumberTableRow{Record(DB_ID_NONE),
.contactID = contact.ID,
.numberUser = number.number.getEntered().c_str(),
.numbere164 = number.number.getE164().c_str(),
@@ 488,7 488,7 @@ auto ContactRecordInterface::Update(const ContactRecord &rec) -> bool
}
}
- ret = contactDB->contacts.update(ContactsTableRow{{.ID = contact.ID},
+ ret = contactDB->contacts.update(ContactsTableRow{Record(contact.ID),
.nameID = contact.nameID,
.numbersID = joinNumberIDs(outputNumberIDs),
.ringID = contact.ringID,
@@ 502,7 502,7 @@ auto ContactRecordInterface::Update(const ContactRecord &rec) -> bool
return false;
}
- ret = contactDB->name.update(ContactsNameTableRow{{.ID = contact.nameID},
+ ret = contactDB->name.update(ContactsNameTableRow{Record(contact.nameID),
.contactID = contact.ID,
.namePrimary = rec.primaryName,
.nameAlternative = rec.alternativeName});
@@ 512,7 512,7 @@ auto ContactRecordInterface::Update(const ContactRecord &rec) -> bool
return false;
}
- ret = contactDB->address.update(ContactsAddressTableRow{{.ID = contact.addressID},
+ ret = contactDB->address.update(ContactsAddressTableRow{Record(contact.addressID),
.contactID = contact.ID,
.address = rec.address,
.note = rec.note,
@@ 642,7 642,7 @@ auto ContactRecordInterface::GetLimitOffset(uint32_t offset, uint32_t limit)
return records;
}
- records->push_back(ContactRecord{{.ID = contact.ID},
+ records->push_back(ContactRecord{Record(contact.ID),
.primaryName = name.namePrimary,
.alternativeName = name.nameAlternative,
.numbers = nrs,
@@ 690,7 690,7 @@ auto ContactRecordInterface::GetLimitOffsetByField(uint32_t offset,
return records;
}
- records->push_back(ContactRecord{{.ID = record.ID},
+ records->push_back(ContactRecord{Record(record.ID),
.primaryName = record.namePrimary,
.alternativeName = record.nameAlternative,
.numbers = nrs,
@@ 733,7 733,7 @@ auto ContactRecordInterface::GetLimitOffsetByField(uint32_t offset,
return records;
}
- records->push_back(ContactRecord{{.ID = record.ID},
+ records->push_back(ContactRecord{Record(record.ID),
.primaryName = name.namePrimary,
.alternativeName = name.nameAlternative,
.numbers = nrs,
@@ 779,7 779,7 @@ auto ContactRecordInterface::GetLimitOffsetByField(uint32_t offset,
}
records->push_back(ContactRecord{
- {.ID = record.ID},
+ Record(record.ID),
.primaryName = name.namePrimary,
.alternativeName = name.nameAlternative,
.numbers = nrs,
@@ 823,7 823,7 @@ auto ContactRecordInterface::GetLimitOffsetByField(uint32_t offset,
return records;
}
- records->push_back(ContactRecord{{.ID = contact.ID},
+ records->push_back(ContactRecord{Record(contact.ID),
.primaryName = name.namePrimary,
.alternativeName = name.nameAlternative,
.numbers = nrs,
@@ 873,7 873,7 @@ auto ContactRecordInterface::GetByName(UTF8 primaryName, UTF8 alternativeName)
return records;
}
- records->push_back(ContactRecord{{.ID = record.ID},
+ records->push_back(ContactRecord{Record(record.ID),
.primaryName = record.namePrimary,
.alternativeName = record.nameAlternative,
.numbers = nrs,
@@ 916,7 916,7 @@ auto ContactRecordInterface::Search(const char *primaryName, const char *alterna
return records;
}
- records->push_back(ContactRecord{{.ID = record.ID},
+ records->push_back(ContactRecord{Record(record.ID),
.primaryName = record.namePrimary,
.alternativeName = record.nameAlternative,
.numbers = nrs,
@@ 956,7 956,7 @@ auto ContactRecordInterface::GetByNumber(const utils::PhoneNumber::View &numberV
if (createTempContact == CreateTempContact::True) {
debug_db_data("Cannot find contact for number %s, creating temporary one", number.c_str());
ContactRecord tmpRecord = {
- {.ID = DB_ID_NONE},
+ Record(DB_ID_NONE),
.numbers = std::vector<ContactRecord::Number>{ContactRecord::Number(numberView)},
};
if (!Add(tmpRecord)) {
@@ 1006,7 1006,7 @@ auto ContactRecordInterface::MatchByNumber(const utils::PhoneNumber::View &numbe
}
debug_db_data("Cannot find contact for number %s, creating temporary one", numberView.getEntered().c_str());
- ContactRecord newContact = {{.ID = DB_ID_NONE},
+ ContactRecord newContact = {Record(DB_ID_NONE),
.numbers = std::vector<ContactRecord::Number>{ContactRecord::Number(numberView)},
.groups = {contactDB->groups.getById(ContactsDB::temporaryGroupId())}};
M module-db/Interface/NotificationsRecord.cpp => module-db/Interface/NotificationsRecord.cpp +1 -1
@@ 93,7 93,7 @@ bool NotificationsRecordInterface::Update(const NotificationsRecord &rec)
uint32_t contactId = rec.contactRecord.has_value() ? rec.contactRecord.value().ID : DB_ID_NONE;
return notificationsDb->notifications.update(NotificationsTableRow{
- {.ID = rec.ID}, .key = static_cast<uint32_t>(rec.key), .value = rec.value, .contactID = contactId});
+ Record(rec.ID), .key = static_cast<uint32_t>(rec.key), .value = rec.value, .contactID = contactId});
}
bool NotificationsRecordInterface::RemoveByID(uint32_t id)
M module-db/Interface/SMSRecord.cpp => module-db/Interface/SMSRecord.cpp +2 -2
@@ 64,7 64,7 @@ bool SMSRecordInterface::Add(const SMSRecord &rec)
auto thread = (*threadRec)[0];
// Create SMS
- if (!smsDB->sms.add(SMSTableRow{{.ID = DB_ID_NONE}, // the entry is not yet in the DB
+ if (!smsDB->sms.add(SMSTableRow{Record(DB_ID_NONE), // the entry is not yet in the DB
.threadID = thread.ID,
.contactID = contactID,
.date = rec.date,
@@ 170,7 170,7 @@ bool SMSRecordInterface::Update(const SMSRecord &recUpdated)
return false;
}
- smsDB->sms.update(SMSTableRow{{.ID = recCurrent.ID},
+ smsDB->sms.update(SMSTableRow{Record(recCurrent.ID),
.threadID = recCurrent.threadID,
.contactID = recCurrent.contactID,
.date = recUpdated.date,
M module-db/Interface/SMSRecord.hpp => module-db/Interface/SMSRecord.hpp +2 -2
@@ 32,11 32,11 @@ struct SMSRecord : public Record
SMSRecord() = default;
SMSRecord(const SMSTableRow &w)
- : Record{.ID = w.ID}, date(w.date), errorCode(w.errorCode), body(w.body), type(w.type), threadID(w.threadID),
+ : Record(w.ID), date(w.date), errorCode(w.errorCode), body(w.body), type(w.type), threadID(w.threadID),
contactID(w.contactID)
{}
SMSRecord(const SMSTableRow &w, const utils::PhoneNumber::View &num)
- : Record{.ID = w.ID}, date(w.date), errorCode(w.errorCode), body(w.body), type(w.type), threadID(w.threadID),
+ : Record(w.ID), date(w.date), errorCode(w.errorCode), body(w.body), type(w.type), threadID(w.threadID),
contactID(w.contactID), number(num)
{}
};
M module-db/Interface/SMSTemplateRecord.cpp => module-db/Interface/SMSTemplateRecord.cpp +2 -2
@@ 27,7 27,7 @@ SMSTemplateRecordInterface::SMSTemplateRecordInterface(SmsDB *smsDb) : smsDB(sms
bool SMSTemplateRecordInterface::Add(const SMSTemplateRecord &rec)
{
return smsDB->templates.add(
- SMSTemplateTableRow{{.ID = rec.ID}, .text = rec.text, .lastUsageTimestamp = rec.lastUsageTimestamp});
+ SMSTemplateTableRow{Record(rec.ID), .text = rec.text, .lastUsageTimestamp = rec.lastUsageTimestamp});
}
uint32_t SMSTemplateRecordInterface::GetCount()
{
@@ 57,7 57,7 @@ bool SMSTemplateRecordInterface::Update(const SMSTemplateRecord &rec)
}
return smsDB->templates.update(
- SMSTemplateTableRow{{.ID = rec.ID}, .text = rec.text, .lastUsageTimestamp = rec.lastUsageTimestamp});
+ SMSTemplateTableRow{Record(rec.ID), .text = rec.text, .lastUsageTimestamp = rec.lastUsageTimestamp});
}
bool SMSTemplateRecordInterface::RemoveByID(uint32_t id)
M module-db/Interface/ThreadRecord.cpp => module-db/Interface/ThreadRecord.cpp +2 -2
@@ 23,7 23,7 @@ ThreadRecordInterface::ThreadRecordInterface(SmsDB *smsDb, ContactsDB *contactsD
bool ThreadRecordInterface::Add(const ThreadRecord &rec)
{
- auto ret = smsDB->threads.add(ThreadsTableRow{{.ID = rec.ID},
+ auto ret = smsDB->threads.add(ThreadsTableRow{Record(rec.ID),
.date = rec.date,
.msgCount = rec.msgCount,
.unreadMsgCount = rec.unreadMsgCount,
@@ 48,7 48,7 @@ bool ThreadRecordInterface::RemoveByID(uint32_t id)
bool ThreadRecordInterface::Update(const ThreadRecord &rec)
{
- return smsDB->threads.update(ThreadsTableRow{{.ID = rec.ID},
+ return smsDB->threads.update(ThreadsTableRow{Record(rec.ID),
.date = rec.date,
.msgCount = rec.msgCount,
.unreadMsgCount = rec.unreadMsgCount,
M module-db/Interface/ThreadRecord.hpp => module-db/Interface/ThreadRecord.hpp +1 -1
@@ 25,7 25,7 @@ struct ThreadRecord : Record
ThreadRecord() = default;
ThreadRecord(const ThreadsTableRow &rec)
- : Record{.ID = rec.ID}, date(rec.date), msgCount(rec.msgCount), unreadMsgCount(rec.unreadMsgCount),
+ : Record(rec.ID), date(rec.date), msgCount(rec.msgCount), unreadMsgCount(rec.unreadMsgCount),
snippet(rec.snippet), type(rec.type), contactID(rec.contactID), numberID(rec.numberID)
{}
M module-db/Tables/ContactsTable.cpp => module-db/Tables/ContactsTable.cpp +1 -1
@@ 96,7 96,7 @@ ContactsTableRow ContactsTable::getByIdCommon(std::unique_ptr<QueryResult> retQu
debug_db_data(
"got results: %" PRIu32 "; ID: %" PRIu32, retQuery->getRowCount(), (*retQuery)[ColumnName::id].getInt32());
return ContactsTableRow{
- {.ID = (*retQuery)[ColumnName::id].getUInt32()},
+ Record((*retQuery)[ColumnName::id].getUInt32()),
.nameID = (*retQuery)[ColumnName::name_id].getUInt32(),
.numbersID = (*retQuery)[ColumnName::numbers_id].getString(),
.ringID = (*retQuery)[ColumnName::ring_id].getUInt32(),
M module-db/Tables/Record.hpp => module-db/Tables/Record.hpp +4 -1
@@ 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
#pragma once
@@ 12,6 12,9 @@ struct Record
{
uint32_t ID = DB_ID_NONE;
+ Record() = default;
+ Record(uint32_t ID) : ID(ID){};
+
bool isValid() const
{
auto result = ID != DB_ID_NONE;
M module-db/tests/CalllogTable_tests.cpp => module-db/tests/CalllogTable_tests.cpp +1 -1
@@ 42,7 42,7 @@ TEST_CASE("Calllog Table tests")
REQUIRE(testRow.isRead == true);
}
- CalllogTableRow testRow = {{.ID = DB_ID_NONE},
+ CalllogTableRow testRow = {Record(DB_ID_NONE),
.number = "600123456",
.e164number = "+48600226908",
.presentation = PresentationType::PR_ALLOWED,
M module-db/tests/ContactGroups_tests.cpp => module-db/tests/ContactGroups_tests.cpp +1 -1
@@ 171,7 171,7 @@ TEST_CASE("Contact Groups tests")
void addSomeContacts(ContactsDB &contactsDb)
{
ContactsTableRow testRow1 = {
- {.ID = 0}, .nameID = 0, .numbersID = "0 1 2 3 4", .ringID = 0, .addressID = 0, .speedDial = "666"
+ Record(0), .nameID = 0, .numbersID = "0 1 2 3 4", .ringID = 0, .addressID = 0, .speedDial = "666"
};
M module-db/tests/ContactsAddressTable_tests.cpp => module-db/tests/ContactsAddressTable_tests.cpp +1 -1
@@ 18,7 18,7 @@ TEST_CASE("Contacts address Table tests")
ContactsDB contactsdb{callogPath.c_str()};
REQUIRE(contactsdb.isInitialized());
- ContactsAddressTableRow testRow1 = {{.ID = DB_ID_NONE},
+ ContactsAddressTableRow testRow1 = {Record(DB_ID_NONE),
.contactID = 0,
.address = "6 Czeczota St.\n02600 Warsaw",
.note = "Test note",
M module-db/tests/ContactsNameTable_tests.cpp => module-db/tests/ContactsNameTable_tests.cpp +1 -1
@@ 26,7 26,7 @@ TEST_CASE("Contacts Name Table tests")
REQUIRE(contactsdb.isInitialized());
ContactsNameTableRow testRow1 = {
- {.ID = DB_ID_NONE}, .contactID = DB_ID_NONE, .namePrimary = "Mateusz", .nameAlternative = "Pati"};
+ Record(DB_ID_NONE), .contactID = DB_ID_NONE, .namePrimary = "Mateusz", .nameAlternative = "Pati"};
const auto contactsCount = contactsdb.name.count() + 1;
// clear contacts table
M module-db/tests/ContactsNumberTable_tests.cpp => module-db/tests/ContactsNumberTable_tests.cpp +1 -1
@@ 26,7 26,7 @@ TEST_CASE("Contacts Number Table tests")
REQUIRE(contactsdb.isInitialized());
ContactsNumberTableRow testRow1 = {
- {.ID = DB_ID_NONE}, .contactID = DB_ID_NONE, .numberUser = "111222333", .numbere164 = "333222111"};
+ Record(DB_ID_NONE), .contactID = DB_ID_NONE, .numberUser = "111222333", .numbere164 = "333222111"};
const auto contactsCount = contactsdb.number.count() + 1;
// clear contacts table
M module-db/tests/ContactsTable_tests.cpp => module-db/tests/ContactsTable_tests.cpp +1 -1
@@ 19,7 19,7 @@ TEST_CASE("Contacts Table tests")
ContactsDB contactsdb{contactsPath.c_str()};
REQUIRE(contactsdb.isInitialized());
- ContactsTableRow testRow1 = {{.ID = DB_ID_NONE},
+ ContactsTableRow testRow1 = {Record(DB_ID_NONE),
.nameID = DB_ID_NONE,
.numbersID = "0 1 2 3 4",
.ringID = DB_ID_NONE,
M module-db/tests/NotificationsRecord_tests.cpp => module-db/tests/NotificationsRecord_tests.cpp +3 -3
@@ 38,7 38,7 @@ TEST_CASE("Notifications Record tests")
SECTION("Constructor from NotificationsTableRow")
{
NotificationsTableRow tableRow{
- {.ID = 10}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 2};
+ Record(10), .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 2};
NotificationsRecord testRec(tableRow);
REQUIRE(testRec.isValid());
REQUIRE(testRec.ID == 10);
@@ 70,12 70,12 @@ TEST_CASE("Notifications Record tests")
REQUIRE(notificationsRecordInterface.GetCount() == 0);
NotificationsTableRow callsRow{
- {.ID = DB_ID_NONE}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 0};
+ Record(DB_ID_NONE), .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 0};
REQUIRE(notificationsDb.notifications.add(callsRow));
NotificationsTableRow smsRow{
- {.ID = DB_ID_NONE}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Sms), .value = 0};
+ Record(DB_ID_NONE), .key = static_cast<uint32_t>(NotificationsRecord::Key::Sms), .value = 0};
REQUIRE(notificationsDb.notifications.add(smsRow));
NotificationsRecord testRec;
M module-db/tests/NotificationsTable_tests.cpp => module-db/tests/NotificationsTable_tests.cpp +6 -6
@@ 32,11 32,11 @@ TEST_CASE("Notifications Table tests")
REQUIRE(notificationsTbl.count() == 0);
NotificationsTableRow callsRow{
- {.ID = DB_ID_NONE}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 0};
+ Record(DB_ID_NONE), .key = static_cast<uint32_t>(NotificationsRecord::Key::Calls), .value = 0};
REQUIRE(notificationsTbl.add(callsRow));
NotificationsTableRow smsRow{
- {.ID = DB_ID_NONE}, .key = static_cast<uint32_t>(NotificationsRecord::Key::Sms), .value = 0};
+ Record(DB_ID_NONE), .key = static_cast<uint32_t>(NotificationsRecord::Key::Sms), .value = 0};
REQUIRE(notificationsTbl.add(smsRow));
REQUIRE(notificationsTbl.count() == 2); // it already got some entries Calls(1) and Sms(2)
@@ 51,8 51,8 @@ TEST_CASE("Notifications Table tests")
REQUIRE_FALSE(testRow.isValid());
}
- REQUIRE(notificationsTbl.add({{.ID = 0}, .key = 3, .value = 8}));
- REQUIRE(notificationsTbl.add({{.ID = 0}, .key = 4, .value = 16, .contactID = 100}));
+ REQUIRE(notificationsTbl.add({Record(0), .key = 3, .value = 8}));
+ REQUIRE(notificationsTbl.add({Record(0), .key = 4, .value = 16, .contactID = 100}));
REQUIRE(notificationsTbl.count() == 4);
@@ 93,7 93,7 @@ TEST_CASE("Notifications Table tests")
SECTION("Entry update")
{
- REQUIRE(notificationsTbl.update({{.ID = 3}, .key = 100, .value = 200, .contactID = 300}));
+ REQUIRE(notificationsTbl.update({Record(3), .key = 100, .value = 200, .contactID = 300}));
auto entry = notificationsTbl.getById(3);
REQUIRE(entry.ID == 3);
REQUIRE(entry.key == 100);
@@ 161,7 161,7 @@ TEST_CASE("Notifications Table tests")
SECTION("Check uniqueness")
{
- REQUIRE(notificationsTbl.add({{.ID = 0}, .key = 3, .value = 100, .contactID = 200}));
+ REQUIRE(notificationsTbl.add({Record(0), .key = 3, .value = 100, .contactID = 200}));
REQUIRE(notificationsTbl.count() == 4);
auto entry = notificationsTbl.getByKey(3);
REQUIRE(entry.isValid());
M module-db/tests/SMSRecord_tests.cpp => module-db/tests/SMSRecord_tests.cpp +1 -1
@@ 183,7 183,7 @@ TEST_CASE("SMS Record tests")
}
ThreadRecord threadRec = threadRecordInterface.GetByID(1);
REQUIRE(threadRec.isValid());
- ThreadsTableRow threadRaw{{.ID = threadRec.ID},
+ ThreadsTableRow threadRaw{Record(threadRec.ID),
.date = threadRec.date,
.msgCount = threadRec.msgCount,
.unreadMsgCount = threadRec.unreadMsgCount,
M module-db/tests/SMSTable_tests.cpp => module-db/tests/SMSTable_tests.cpp +2 -2
@@ 24,7 24,7 @@ TEST_CASE("SMS Table tests")
SmsDB smsdb(smsPath.c_str());
REQUIRE(smsdb.isInitialized());
- SMSTableRow testRow1 = {{.ID = 0},
+ SMSTableRow testRow1 = {Record(0),
.threadID = 0,
.contactID = 0,
.date = 0,
@@ 34,7 34,7 @@ TEST_CASE("SMS Table tests")
};
- SMSTableRow testRow2 = {{.ID = 0},
+ SMSTableRow testRow2 = {Record(0),
.threadID = 0,
.contactID = 0,
.date = 0,
M module-db/tests/SMSTemplateTable_tests.cpp => module-db/tests/SMSTemplateTable_tests.cpp +1 -1
@@ 29,7 29,7 @@ TEST_CASE("SMS Templates Table tests")
auto &templatesTbl = smsDb.templates;
- SMSTemplateTableRow testRow = {{.ID = 0}, .text = "Test text", .lastUsageTimestamp = 100};
+ SMSTemplateTableRow testRow = {Record(0), .text = "Test text", .lastUsageTimestamp = 100};
const auto templatesCount = templatesTbl.count() + 1;
// clear sms table
M module-db/tests/ThreadsTable_tests.cpp => module-db/tests/ThreadsTable_tests.cpp +1 -1
@@ 26,7 26,7 @@ TEST_CASE("Threads Table tests")
SmsDB smsdb{smsPath.c_str()};
REQUIRE(smsdb.isInitialized());
- ThreadsTableRow testRow1 = {{.ID = 0},
+ ThreadsTableRow testRow1 = {Record(0),
.date = 0,
.msgCount = 0,
.unreadMsgCount = 0,
M module-services/service-desktop/endpoints/BaseHelper.hpp => module-services/service-desktop/endpoints/BaseHelper.hpp +1 -0
@@ 3,6 3,7 @@
#pragma once
+#include <optional>
#include <parser/HttpEnums.hpp>
#include <endpoints/ResponseContext.hpp>