refactor: move away from UnitTest.cmake
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#include <QTest>
|
||||
#include <QDebug>
|
||||
#include "TestUtil.h"
|
||||
|
||||
#include "minecraft/MojangVersionFormat.h"
|
||||
|
||||
@ -8,9 +7,8 @@ class MojangVersionFormatTest : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
static QJsonDocument readJson(const char *file)
|
||||
static QJsonDocument readJson(const QString path)
|
||||
{
|
||||
auto path = QFINDTESTDATA(file);
|
||||
QFile jsonFile(path);
|
||||
jsonFile.open(QIODevice::ReadOnly);
|
||||
auto data = jsonFile.readAll();
|
||||
@ -31,7 +29,7 @@ private
|
||||
slots:
|
||||
void test_Through_Simple()
|
||||
{
|
||||
QJsonDocument doc = readJson("data/1.9-simple.json");
|
||||
QJsonDocument doc = readJson(QFINDTESTDATA("testdata/1.9-simple.json"));
|
||||
auto vfile = MojangVersionFormat::versionFileFromJson(doc, "1.9-simple.json");
|
||||
auto doc2 = MojangVersionFormat::versionFileToJson(vfile);
|
||||
writeJson("1.9-simple-passthorugh.json", doc2);
|
||||
@ -41,7 +39,7 @@ slots:
|
||||
|
||||
void test_Through()
|
||||
{
|
||||
QJsonDocument doc = readJson("data/1.9.json");
|
||||
QJsonDocument doc = readJson(QFINDTESTDATA("testdata/1.9.json"));
|
||||
auto vfile = MojangVersionFormat::versionFileFromJson(doc, "1.9.json");
|
||||
auto doc2 = MojangVersionFormat::versionFileToJson(vfile);
|
||||
writeJson("1.9-passthorugh.json", doc2);
|
||||
|
Reference in New Issue
Block a user