MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / TexturePackParseTest

Class TexturePackParseTest

tests/TexturePackParse_test.cpp:28–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26#include "minecraft/mod/tasks/LocalTexturePackParseTask.h"
27
28class TexturePackParseTest : public QObject {
29 Q_OBJECT
30
31 private slots:
32 void test_parseZIP()
33 {
34 QString source = QFINDTESTDATA("testdata/TexturePackParse");
35
36 QString zip_rp = FS::PathCombine(source, "test_texture_pack_idk.zip");
37 TexturePack pack{ QFileInfo(zip_rp) };
38
39 bool valid = TexturePackUtils::processZIP(pack);
40
41 QVERIFY(pack.description() == "joe biden, wake up");
42 QVERIFY(valid == true);
43 }
44
45 void test_parseFolder()
46 {
47 QString source = QFINDTESTDATA("testdata/TexturePackParse");
48
49 QString folder_rp = FS::PathCombine(source, "test_texturefolder");
50 TexturePack pack{ QFileInfo(folder_rp) };
51
52 bool valid = TexturePackUtils::processFolder(pack, TexturePackUtils::ProcessingLevel::BasicInfoOnly);
53
54 QVERIFY(pack.description() == "Some texture pack surely");
55 QVERIFY(valid == true);
56 }
57
58 void test_parseFolder2()
59 {
60 QString source = QFINDTESTDATA("testdata/TexturePackParse");
61
62 QString folder_rp = FS::PathCombine(source, "another_test_texturefolder");
63 TexturePack pack{ QFileInfo(folder_rp) };
64
65 bool valid = TexturePackUtils::process(pack, TexturePackUtils::ProcessingLevel::BasicInfoOnly);
66
67 QVERIFY(pack.description() == "quieres\nfor real");
68 QVERIFY(valid == true);
69 }
70};
71
72QTEST_GUILESS_MAIN(TexturePackParseTest)
73

Callers

nothing calls this directly

Calls 4

PathCombineFunction · 0.85
QFileInfoClass · 0.85
processZIPFunction · 0.50
descriptionMethod · 0.45

Tested by

no test coverage detected