test: Fixed tests

This commit is contained in:
Eberhard Graether
2015-09-17 15:07:46 +02:00
parent b36e3fb758
commit 04f24ba63d
12 changed files with 328 additions and 32 deletions
+6
View File
@@ -6,6 +6,12 @@ FileInfo::FileInfo()
{
}
FileInfo::FileInfo(const FilePath& path)
: path(path)
, lastWriteTime(boost::posix_time::not_a_date_time)
{
}
FileInfo::FileInfo(const FilePath& path, boost::posix_time::ptime lastWriteTime)
: path(path)
, lastWriteTime(lastWriteTime)
+1
View File
@@ -10,6 +10,7 @@
struct FileInfo
{
FileInfo();
FileInfo(const FilePath& path);
FileInfo(const FilePath& path, boost::posix_time::ptime lastWriteTime);
FilePath path;
+3 -5
View File
@@ -6,10 +6,8 @@
#include "utility/file/FileSystem.h"
#include "utility/logging/logging.h"
#include "utility/utility.h"
#include "data/access/StorageAccessProxy.h"
FileManager::FileManager(StorageAccessProxy* storageAccessProxy)
: m_storageAccessProxy(storageAccessProxy)
FileManager::FileManager()
{
}
@@ -47,9 +45,9 @@ void FileManager::reset()
m_removedFiles.clear();
}
void FileManager::fetchFilePaths()
void FileManager::fetchFilePaths(const std::vector<FileInfo>& oldFileInfos)
{
for (FileInfo oldFileInfo: m_storageAccessProxy->getInfoOnAllFiles())
for (FileInfo oldFileInfo: oldFileInfos)
{
m_files[oldFileInfo.path] = oldFileInfo;
}
+2 -6
View File
@@ -7,12 +7,10 @@
#include "utility/file/FileInfo.h"
class StorageAccessProxy;
class FileManager
{
public:
FileManager(StorageAccessProxy* storageAccessProxy);
FileManager();
virtual ~FileManager();
const std::vector<FilePath>& getSourcePaths() const;
@@ -26,7 +24,7 @@ public:
);
void reset();
void fetchFilePaths();
void fetchFilePaths(const std::vector<FileInfo>& oldFileInfos);
std::set<FilePath> getAddedFilePaths() const;
std::set<FilePath> getUpdatedFilePaths() const;
@@ -51,8 +49,6 @@ private:
std::set<FilePath> m_addedFiles;
std::set<FilePath> m_updatedFiles;
std::set<FilePath> m_removedFiles;
StorageAccessProxy* m_storageAccessProxy;
};
#endif // FILE_MANAGER_H