| 26 | #include "minecraft/mod/tasks/LocalTexturePackParseTask.h" |
| 27 | |
| 28 | class 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 | |
| 69 | QTEST_GUILESS_MAIN(TexturePackParseTest) |
| 70 |
nothing calls this directly
no test coverage detected