nextcloud-desktop/test/testunisonfolder.cpp
Duncan Mac-Vicar P 3f32499c4e If the first event happens before 5 secs after starting the
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.
2011-03-31 19:07:45 +02:00

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"