add_subdirectory(src)
if (UNIT_TESTING)
- set(WITH_UNIT_TESTING ON)
+ set(WITH_TESTING ON)
find_package(CMocka)
if (CMOCKA_FOUND)
#cmakedefine HAVE___MINGW_ASPRINTF 1
#cmakedefine HAVE_ASPRINTF 1
-#cmakedefine WITH_UNIT_TESTING 1
+#cmakedefine WITH_TESTING 1
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
#include "csync_log.h"
-#ifndef WITH_UNIT_TESTING
+#ifndef WITH_TESTING
static
#endif
int _csync_exclude_add(c_strlist_t **inList, const char *string) {
};
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
-#ifdef WITH_UNIT_TESTING
+#ifdef WITH_TESTING
int OCSYNC_EXPORT _csync_exclude_add(c_strlist_t **inList, const char *string);
#endif
_excludeFiles.insert(path);
}
-#ifdef WITH_UNIT_TESTING
+#ifdef WITH_TESTING
void ExcludedFiles::addExcludeExpr(const QString &expr)
{
_csync_exclude_add(_excludesPtr, expr.toLatin1().constData());
const QString& basePath,
bool excludeHidden) const;
-#ifdef WITH_UNIT_TESTING
+#ifdef WITH_TESTING
void addExcludeExpr(const QString &expr);
#endif
// change during the checksum calculation
_item->_modtime = FileSystem::getModTime(filePath);
+#ifdef WITH_TESTING
_stopWatch.start();
+#endif
QByteArray checksumType = contentChecksumType();
_item->_contentChecksum = contentChecksum;
_item->_contentChecksumType = contentChecksumType;
+#ifdef WITH_TESTING
_stopWatch.addLapTime(QLatin1String("ContentChecksum"));
_stopWatch.start();
+#endif
// Reuse the content checksum as the transmission checksum if possible
const auto supportedTransmissionChecksums =
done(SyncFileItem::SoftError, tr("File Removed"));
return;
}
+#ifdef WITH_TESTING
_stopWatch.addLapTime(QLatin1String("TransmissionChecksum"));
+#endif
time_t prevModtime = _item->_modtime; // the _item value was set in PropagateUploadFile::start()
// but a potential checksum calculation could have taken some time during which the file could
bool _deleteExisting;
// measure the performance of checksum calc and upload
+#ifdef WITH_TESTING
Utility::StopWatch _stopWatch;
+#endif
QByteArray _transmissionChecksum;
QByteArray _transmissionChecksumType;
}
_item->_responseTimeStamp = job->responseTimestamp();
+#ifdef WITH_TESTING
// performance logging
quint64 duration = _stopWatch.stop();
qDebug() << "*==* duration UPLOAD" << _item->_size
<< duration;
// The job might stay alive for the whole sync, release this tiny bit of memory.
_stopWatch.reset();
+#endif
finalize();
}
done(SyncFileItem::SoftError, "Server does not support X-OC-MTime");
}
+#ifdef WITH_TESTING
// performance logging
quint64 duration = _stopWatch.stop();
qDebug() << "*==* duration UPLOAD" << _item->_size
<< duration;
// The job might stay alive for the whole sync, release this tiny bit of memory.
_stopWatch.reset();
+#endif
finalize();
}