Переглянути джерело

set mtime when building local sync folder state in automated tests

would allow checking mtime with a correct value instead of having a
default value

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Matthieu Gallien 3 роки тому
батько
коміт
b04128fd34
2 змінених файлів з 2 додано та 1 видалено
  1. 1 1
      test/syncenginetestutils.cpp
  2. 1 0
      test/syncenginetestutils.h

+ 1 - 1
test/syncenginetestutils.cpp

@@ -1209,7 +1209,7 @@ void FakeFolder::fromDisk(QDir &dir, FileInfo &templateFi)
                 continue;
             }
             char contentChar = content.at(0);
-            templateFi.children.insert(diskChild.fileName(), FileInfo { diskChild.fileName(), diskChild.size(), contentChar });
+            templateFi.children.insert(diskChild.fileName(), FileInfo{diskChild.fileName(), diskChild.size(), contentChar, diskChild.lastModified()});
         }
     }
 }

+ 1 - 0
test/syncenginetestutils.h

@@ -117,6 +117,7 @@ public:
     FileInfo(const QString &name) : name{name} { }
     FileInfo(const QString &name, qint64 size) : name{name}, isDir{false}, size{size} { }
     FileInfo(const QString &name, qint64 size, char contentChar) : name{name}, isDir{false}, size{size}, contentChar{contentChar} { }
+    FileInfo(const QString &name, qint64 size, char contentChar, QDateTime mtime) : name{name}, isDir{false}, lastModified(mtime), size{size}, contentChar{contentChar} { }
     FileInfo(const QString &name, const std::initializer_list<FileInfo> &children);
 
     void addChild(const FileInfo &info);