test: Fixed tests
This commit is contained in:
+1
-2
@@ -79,7 +79,7 @@ void Project::parseCode()
|
||||
|
||||
std::shared_ptr<ProjectSettings> projSettings = ProjectSettings::getInstance();
|
||||
|
||||
m_fileManager.fetchFilePaths();
|
||||
m_fileManager.fetchFilePaths(m_storage->getInfoOnAllFiles());
|
||||
std::set<FilePath> addedFilePaths = m_fileManager.getAddedFilePaths();
|
||||
std::set<FilePath> updatedFilePaths = m_fileManager.getUpdatedFilePaths();
|
||||
std::set<FilePath> removedFilePaths = m_fileManager.getRemovedFilePaths();
|
||||
@@ -178,6 +178,5 @@ Parser::Arguments Project::getParserArguments() const
|
||||
|
||||
Project::Project(StorageAccessProxy* storageAccessProxy)
|
||||
: m_storageAccessProxy(storageAccessProxy)
|
||||
, m_fileManager(storageAccessProxy)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ void SqliteStorage::clear()
|
||||
{
|
||||
m_database.execDML("PRAGMA foreign_keys=OFF;");
|
||||
clearTables();
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
void SqliteStorage::beginTransaction()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
struct FileInfo
|
||||
{
|
||||
FileInfo();
|
||||
FileInfo(const FilePath& path);
|
||||
FileInfo(const FilePath& path, boost::posix_time::ptime lastWriteTime);
|
||||
|
||||
FilePath path;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user