mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 11:50:37 +02:00
adding first tests for SyncManager
This commit is contained in:
parent
6d148994ee
commit
cdf6241da4
@ -1 +1 @@
|
||||
Subproject commit 61feac4632372fcf781449da0bf0de14f1793af8
|
||||
Subproject commit 5ee82764e7fdcd6566b7eceac985b42348e2efcd
|
||||
@ -62,14 +62,20 @@ bool SyncManager::startSynchronization()
|
||||
// NOW I HAVE DATA FROM DATABASE
|
||||
|
||||
|
||||
|
||||
colnod->downloadData();
|
||||
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
|
||||
qDebug(syncmanager) << "I have colnod and database data";
|
||||
qDebug(syncmanager) << "updated token count" << data->updatedTokens.count();
|
||||
|
||||
});
|
||||
|
||||
return true;
|
||||
|
||||
@ -2,3 +2,4 @@ TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS += \
|
||||
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