mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 16:50:48 +02:00
Merge branch 'feat/syncmanager-unittests' into 'master'
adding first tests for SyncManager See merge request spaceti-app/integrations/acs/colnod-connector!27
This commit is contained in:
commit
7578c3e658
@ -1 +1 @@
|
|||||||
Subproject commit ee08677641fef053a8f6938f9b31e6792cbe7fff
|
Subproject commit 5ee82764e7fdcd6566b7eceac985b42348e2efcd
|
||||||
@ -62,14 +62,20 @@ bool SyncManager::startSynchronization()
|
|||||||
// NOW I HAVE DATA FROM DATABASE
|
// NOW I HAVE DATA FROM DATABASE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
colnod->downloadData();
|
colnod->downloadData();
|
||||||
connect(colnod.get(), &ColnodAPI::downloadDataFinished, [=](std::shared_ptr<Data> data) {
|
connect(colnod.get(), &ColnodAPI::downloadDataFinished, [=](std::shared_ptr<Data> data) {
|
||||||
// NOW I HAVE DATA FROM COLNOD
|
if (!data) {
|
||||||
|
qCritical(syncmanager) << "Not possible to get correct data from colnod";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// NOW I HAVE DATA FROM COLNOD
|
||||||
// I can process data
|
// I can process data
|
||||||
qDebug(syncmanager) << "I have colnod and database data";
|
qDebug(syncmanager) << "I have colnod and database data";
|
||||||
qDebug(syncmanager) << "updated token count" << data->updatedTokens.count();
|
qDebug(syncmanager) << "updated token count" << data->updatedTokens.count();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,3 +2,4 @@ TEMPLATE = subdirs
|
|||||||
|
|
||||||
SUBDIRS += \
|
SUBDIRS += \
|
||||||
database/tst_databaseapi.pro \
|
database/tst_databaseapi.pro \
|
||||||
|
syncmanager/tst_syncmanager.pro \
|
||||||
|
|||||||
23
test/auto/syncmanager/tst_syncmanager.cpp
Normal file
23
test/auto/syncmanager/tst_syncmanager.cpp
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
#include "syncmanager.h"
|
||||||
|
// add necessary includes here
|
||||||
|
|
||||||
|
class SyncManagerTest : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private slots:
|
||||||
|
void sync_init_test();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void SyncManagerTest::sync_init_test()
|
||||||
|
{
|
||||||
|
SyncManager sync(true);
|
||||||
|
|
||||||
|
QVERIFY(sync.databaseInitialization());
|
||||||
|
}
|
||||||
|
|
||||||
|
QTEST_MAIN(SyncManagerTest)
|
||||||
|
|
||||||
|
#include "tst_syncmanager.moc"
|
||||||
11
test/auto/syncmanager/tst_syncmanager.pro
Normal file
11
test/auto/syncmanager/tst_syncmanager.pro
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
QT += testlib
|
||||||
|
QT -= gui
|
||||||
|
|
||||||
|
CONFIG += qt console warn_on depend_includepath testcase
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
|
||||||
|
TEMPLATE = app
|
||||||
|
|
||||||
|
SOURCES += tst_syncmanager.cpp
|
||||||
|
|
||||||
|
include(../../test.pri)
|
||||||
Loading…
x
Reference in New Issue
Block a user