aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp2
-rw-r--r--launcher/minecraft/mod/tasks/LocalWorldSaveParseTask.h2
-rw-r--r--tests/ResourcePackParse_test.cpp9
-rw-r--r--tests/TexturePackParse_test.cpp9
-rw-r--r--tests/testdata/ResourcePackParse/test_resource_pack_idk.zipbin322 -> 804 bytes
5 files changed, 14 insertions, 8 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp b/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp
index e4492f12..38f1d7c1 100644
--- a/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp
+++ b/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.cpp
@@ -116,7 +116,7 @@ bool processZIP(TexturePack& pack, ProcessingLevel level)
if (level == ProcessingLevel::BasicInfoOnly) {
zip.close();
- return false;
+ return true;
}
if (zip.setCurrentFile("pack.png")) {
diff --git a/launcher/minecraft/mod/tasks/LocalWorldSaveParseTask.h b/launcher/minecraft/mod/tasks/LocalWorldSaveParseTask.h
index 44153735..aa5db0c2 100644
--- a/launcher/minecraft/mod/tasks/LocalWorldSaveParseTask.h
+++ b/launcher/minecraft/mod/tasks/LocalWorldSaveParseTask.h
@@ -37,7 +37,7 @@ bool process(WorldSave& save, ProcessingLevel level = ProcessingLevel::Full);
bool processZIP(WorldSave& pack, ProcessingLevel level = ProcessingLevel::Full);
bool processFolder(WorldSave& pack, ProcessingLevel level = ProcessingLevel::Full);
-bool validate(QFileInfo file);
+bool validate(QFileInfo file);
} // namespace WorldSaveUtils
diff --git a/tests/ResourcePackParse_test.cpp b/tests/ResourcePackParse_test.cpp
index 568c3b63..4192da31 100644
--- a/tests/ResourcePackParse_test.cpp
+++ b/tests/ResourcePackParse_test.cpp
@@ -35,10 +35,11 @@ class ResourcePackParseTest : public QObject {
QString zip_rp = FS::PathCombine(source, "test_resource_pack_idk.zip");
ResourcePack pack { QFileInfo(zip_rp) };
- ResourcePackUtils::processZIP(pack);
+ bool valid = ResourcePackUtils::processZIP(pack, ResourcePackUtils::ProcessingLevel::BasicInfoOnly);
QVERIFY(pack.packFormat() == 3);
QVERIFY(pack.description() == "um dois, feijão com arroz, três quatro, feijão no prato, cinco seis, café inglês, sete oito, comer biscoito, nove dez comer pastéis!!");
+ QVERIFY(valid == true);
}
void test_parseFolder()
@@ -48,10 +49,11 @@ class ResourcePackParseTest : public QObject {
QString folder_rp = FS::PathCombine(source, "test_folder");
ResourcePack pack { QFileInfo(folder_rp) };
- ResourcePackUtils::processFolder(pack);
+ bool valid = ResourcePackUtils::processFolder(pack, ResourcePackUtils::ProcessingLevel::BasicInfoOnly);
QVERIFY(pack.packFormat() == 1);
QVERIFY(pack.description() == "Some resource pack maybe");
+ QVERIFY(valid == true);
}
void test_parseFolder2()
@@ -61,10 +63,11 @@ class ResourcePackParseTest : public QObject {
QString folder_rp = FS::PathCombine(source, "another_test_folder");
ResourcePack pack { QFileInfo(folder_rp) };
- ResourcePackUtils::process(pack);
+ bool valid = ResourcePackUtils::process(pack, ResourcePackUtils::ProcessingLevel::BasicInfoOnly);
QVERIFY(pack.packFormat() == 6);
QVERIFY(pack.description() == "o quartel pegou fogo, policia deu sinal, acode acode acode a bandeira nacional");
+ QVERIFY(valid == false);
}
};
diff --git a/tests/TexturePackParse_test.cpp b/tests/TexturePackParse_test.cpp
index 0771f79f..4ddc0a3a 100644
--- a/tests/TexturePackParse_test.cpp
+++ b/tests/TexturePackParse_test.cpp
@@ -36,9 +36,10 @@ class TexturePackParseTest : public QObject {
QString zip_rp = FS::PathCombine(source, "test_texture_pack_idk.zip");
TexturePack pack { QFileInfo(zip_rp) };
- TexturePackUtils::processZIP(pack);
+ bool valid = TexturePackUtils::processZIP(pack);
QVERIFY(pack.description() == "joe biden, wake up");
+ QVERIFY(valid == true);
}
void test_parseFolder()
@@ -48,9 +49,10 @@ class TexturePackParseTest : public QObject {
QString folder_rp = FS::PathCombine(source, "test_texturefolder");
TexturePack pack { QFileInfo(folder_rp) };
- TexturePackUtils::processFolder(pack);
+ bool valid = TexturePackUtils::processFolder(pack, TexturePackUtils::ProcessingLevel::BasicInfoOnly);
QVERIFY(pack.description() == "Some texture pack surely");
+ QVERIFY(valid == true);
}
void test_parseFolder2()
@@ -60,9 +62,10 @@ class TexturePackParseTest : public QObject {
QString folder_rp = FS::PathCombine(source, "another_test_texturefolder");
TexturePack pack { QFileInfo(folder_rp) };
- TexturePackUtils::process(pack);
+ bool valid = TexturePackUtils::process(pack, TexturePackUtils::ProcessingLevel::BasicInfoOnly);
QVERIFY(pack.description() == "quieres\nfor real");
+ QVERIFY(valid == true);
}
};
diff --git a/tests/testdata/ResourcePackParse/test_resource_pack_idk.zip b/tests/testdata/ResourcePackParse/test_resource_pack_idk.zip
index 52b91cdc..b4e66a60 100644
--- a/tests/testdata/ResourcePackParse/test_resource_pack_idk.zip
+++ b/tests/testdata/ResourcePackParse/test_resource_pack_idk.zip
Binary files differ