nextcloud-desktop/test/testunisonfolder.cpp

44 lines
884 B
C++
Raw Normal View History

2011-03-31 01:36:30 +04:00
#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()
{
}
void TestUnisonFolder::cleanupTestCase()
{
}
void TestUnisonFolder::testSyncFiles()
{
Mirall::TemporaryDir tmp1;
Mirall::TemporaryDir tmp2;
qDebug() << tmp1.path() << tmp2.path();
2011-04-06 11:52:02 +04:00
Mirall::INotify::initialize();
Mirall::UnisonFolder folder("alias", tmp1.path(), tmp2.path(), this);
2011-03-31 01:36:30 +04:00
// create a directory in the first
QDir(tmp1.path()).mkdir("foo");
QTest::qWait(1000);
2011-03-31 01:36:30 +04:00
QVERIFY(QDir(tmp2.path() + "/foo").exists());
2011-04-06 11:52:02 +04:00
Mirall::INotify::cleanup();
2011-03-31 01:36:30 +04:00
}
QTEST_MAIN(TestUnisonFolder)
#include "testunisonfolder.moc"