aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/FileSystem_test.cpp26
-rw-r--r--tests/GZip_test.cpp2
2 files changed, 27 insertions, 1 deletions
diff --git a/tests/FileSystem_test.cpp b/tests/FileSystem_test.cpp
index 47a963b0..21270f6f 100644
--- a/tests/FileSystem_test.cpp
+++ b/tests/FileSystem_test.cpp
@@ -183,6 +183,32 @@ slots:
f();
}
+ void test_copy_single_file()
+ {
+ QTemporaryDir tempDir;
+ tempDir.setAutoRemove(true);
+
+ {
+ QString file = QFINDTESTDATA("testdata/FileSystem/test_folder/pack.mcmeta");
+
+ qDebug() << "From:" << file << "To:" << tempDir.path();
+
+ QDir target_dir(FS::PathCombine(tempDir.path(), "pack.mcmeta"));
+ qDebug() << tempDir.path();
+ qDebug() << target_dir.path();
+ FS::copy c(file, target_dir.filePath("pack.mcmeta"));
+ c();
+
+ auto filter = QDir::Filter::Files;
+
+ for (auto entry: target_dir.entryList(filter)) {
+ qDebug() << entry;
+ }
+
+ QVERIFY(target_dir.entryList(filter).contains("pack.mcmeta"));
+ }
+ }
+
void test_getDesktop()
{
QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
diff --git a/tests/GZip_test.cpp b/tests/GZip_test.cpp
index 1e762b2e..82503d81 100644
--- a/tests/GZip_test.cpp
+++ b/tests/GZip_test.cpp
@@ -24,7 +24,7 @@ slots:
QByteArray compressed;
QByteArray decompressed;
std::default_random_engine eng((std::random_device())());
- std::uniform_int_distribution<uint8_t> idis(0, std::numeric_limits<uint8_t>::max());
+ std::uniform_int_distribution<uint16_t> idis(0, std::numeric_limits<uint8_t>::max());
// initialize random buffer
for(int i = 0; i < size; i++)