mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
program, it will always cause it to queue it to avoid event flood (5 secs). So don't init the QTime for last event, and then check if it is null.
44 lines
875 B
C++
44 lines
875 B
C++
#include <cstdlib>
|
|
#include <cerrno>
|
|
#include <cstring>
|
|
|
|
#include <QDebug>
|
|
#include <QDir>
|
|
#include <QFileInfo>
|
|
|
|
#include "mirall/inotify.h"
|
|
#include "mirall/unisonfolder.h"
|
|
#include "mirall/temporarydir.h"
|
|
#include "testunisonfolder.h"
|
|
|
|
//static char dir_template[] = "/tmp/miralXXXXXX";
|
|
|
|
void TestUnisonFolder::initTestCase()
|
|
{
|
|
Mirall::INotify::initialize();
|
|
}
|
|
|
|
void TestUnisonFolder::cleanupTestCase()
|
|
{
|
|
Mirall::INotify::cleanup();
|
|
}
|
|
|
|
void TestUnisonFolder::testSyncFiles()
|
|
{
|
|
Mirall::TemporaryDir tmp1;
|
|
Mirall::TemporaryDir tmp2;
|
|
|
|
qDebug() << tmp1.path() << tmp2.path();
|
|
|
|
|
|
Mirall::UnisonFolder folder(tmp1.path(), tmp2.path(), this);
|
|
|
|
// create a directory in the first
|
|
QDir(tmp1.path()).mkdir("foo");
|
|
QTest::qWait(1000);
|
|
QVERIFY(QDir(tmp2.path() + "/foo").exists());
|
|
}
|
|
|
|
QTEST_MAIN(TestUnisonFolder)
|
|
#include "testunisonfolder.moc"
|