Update tests to make use of the new ApiType enum
This commit is contained in:
parent
d3da86ff28
commit
316c1fb1ae
1 changed files with 13 additions and 1 deletions
|
@ -21,11 +21,14 @@
|
||||||
#include "test_danbooru_post.h"
|
#include "test_danbooru_post.h"
|
||||||
#include "../danboorupost.h"
|
#include "../danboorupost.h"
|
||||||
#include "../utils.h"
|
#include "../utils.h"
|
||||||
|
#include "../servicebase.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TestDanbooruPost::initTestCase()
|
void TestDanbooruPost::initTestCase()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -42,7 +45,14 @@ void TestDanbooruPost::testPostLoading()
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
auto data = Danbooru::parseDanbooruResult(file.readAll(), &ok).toList().at(0).toMap();
|
auto data = Danbooru::parseDanbooruResult(file.readAll(), &ok).toList().at(0).toMap();
|
||||||
auto post = new Danbooru::DanbooruPost(data);
|
|
||||||
|
if (!ok) {
|
||||||
|
QFAIL("JSON file failed to load");
|
||||||
|
}
|
||||||
|
|
||||||
|
QFETCH(Danbooru::ApiType, apiType);
|
||||||
|
|
||||||
|
auto post = new Danbooru::DanbooruPost(data, apiType);
|
||||||
|
|
||||||
QFETCH(int, postId);
|
QFETCH(int, postId);
|
||||||
QFETCH(int, postWidth);
|
QFETCH(int, postWidth);
|
||||||
|
@ -70,6 +80,7 @@ void TestDanbooruPost::testPostLoading_data()
|
||||||
{
|
{
|
||||||
//TODO: Add API type
|
//TODO: Add API type
|
||||||
QTest::addColumn<QString>("jsonFile");
|
QTest::addColumn<QString>("jsonFile");
|
||||||
|
QTest::addColumn<Danbooru::ApiType>("apiType");
|
||||||
QTest::addColumn<int>("postId");
|
QTest::addColumn<int>("postId");
|
||||||
QTest::addColumn<int>("postWidth");
|
QTest::addColumn<int>("postWidth");
|
||||||
QTest::addColumn<int>("postHeight");
|
QTest::addColumn<int>("postHeight");
|
||||||
|
@ -85,6 +96,7 @@ void TestDanbooruPost::testPostLoading_data()
|
||||||
|
|
||||||
// Konachan.com / yande.re
|
// Konachan.com / yande.re
|
||||||
QTest::newRow("konachan") << "konachan.json" // jsonFile
|
QTest::newRow("konachan") << "konachan.json" // jsonFile
|
||||||
|
<< Danbooru::ApiType::KonachanDanbooru
|
||||||
<< 205621 // id
|
<< 205621 // id
|
||||||
<< 1280 // width
|
<< 1280 // width
|
||||||
<< 720 // height
|
<< 720 // height
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue