MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / TexturePackParseTest

Class TexturePackParseTest

tests/TexturePackParse_test.cpp:28–67  ·  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 TexturePackUtils::processZIP(pack);
40
41 QVERIFY(pack.description() == "joe biden, wake up");
42 }
43
44 void test_parseFolder()
45 {
46 QString source = QFINDTESTDATA("testdata/TexturePackParse");
47
48 QString folder_rp = FS::PathCombine(source, "test_texturefolder");
49 TexturePack pack { QFileInfo(folder_rp) };
50
51 TexturePackUtils::processFolder(pack);
52
53 QVERIFY(pack.description() == "Some texture pack surely");
54 }
55
56 void test_parseFolder2()
57 {
58 QString source = QFINDTESTDATA("testdata/TexturePackParse");
59
60 QString folder_rp = FS::PathCombine(source, "another_test_texturefolder");
61 TexturePack pack { QFileInfo(folder_rp) };
62
63 TexturePackUtils::process(pack);
64
65 QVERIFY(pack.description() == "quieres\nfor real");
66 }
67};
68
69QTEST_GUILESS_MAIN(TexturePackParseTest)
70

Callers

nothing calls this directly

Calls 3

PathCombineFunction · 0.85
processZIPFunction · 0.50
descriptionMethod · 0.45

Tested by

no test coverage detected