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

Method test_onenine

tests/Library_test.cpp:229–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 }
228 }
229 void test_onenine()
230 {
231 RuntimeContext r = dummyContext("osx");
232 auto test = readMojangJson(QFINDTESTDATA("testdata/Library/lib-simple.json"));
233 {
234 QStringList jar, native, native32, native64;
235 test->getApplicableFiles(r, jar, native, native32, native64, QString());
236 QCOMPARE(jar, getStorage("com/paulscode/codecwav/20101023/codecwav-20101023.jar"));
237 QCOMPARE(native, {});
238 QCOMPARE(native32, {});
239 QCOMPARE(native64, {});
240 }
241 r.system = "linux";
242 {
243 QStringList failedFiles;
244 auto dls = test->getDownloads(r, cache.get(), failedFiles, QString());
245 QCOMPARE(dls.size(), 1);
246 QCOMPARE(failedFiles, {});
247 QCOMPARE(dls[0]->url(), QUrl("https://libraries.minecraft.net/com/paulscode/codecwav/20101023/codecwav-20101023.jar"));
248 }
249 r.system = "osx";
250 test->setHint("local");
251 {
252 QStringList jar, native, native32, native64;
253 test->getApplicableFiles(r, jar, native, native32, native64, QFINDTESTDATA("testdata/Library"));
254 QCOMPARE(jar, { QFileInfo(QFINDTESTDATA("testdata/Library/codecwav-20101023.jar")).absoluteFilePath() });
255 QCOMPARE(native, {});
256 QCOMPARE(native32, {});
257 QCOMPARE(native64, {});
258 }
259 r.system = "linux";
260 {
261 QStringList failedFiles;
262 auto dls = test->getDownloads(r, cache.get(), failedFiles, QFINDTESTDATA("testdata/Library"));
263 QCOMPARE(dls.size(), 0);
264 QCOMPARE(failedFiles, {});
265 }
266 }
267 void test_onenine_local_override()
268 {
269 RuntimeContext r = dummyContext("osx");

Callers

nothing calls this directly

Calls 9

QStringClass · 0.85
QUrlClass · 0.85
QFileInfoClass · 0.85
getApplicableFilesMethod · 0.80
getDownloadsMethod · 0.80
setHintMethod · 0.80
getMethod · 0.45
sizeMethod · 0.45
urlMethod · 0.45

Tested by

no test coverage detected