pollymc/tests/tst_inifile.cpp
Petr Mrázek 9249768db5 NOISSUE Make tests no longer use the MultiMC object
They do not require the application part anymore
2015-04-02 11:30:38 +02:00

44 lines
863 B
C++

#include <QTest>
#include "TestUtil.h"
#include "logic/settings/INIFile.h"
class IniFileTest : public QObject
{
Q_OBJECT
private
slots:
void initTestCase()
{
}
void cleanupTestCase()
{
}
void test_PathCombine1_data()
{
QTest::addColumn<QString>("through");
QTest::newRow("unix path") << "/abc/def/ghi/jkl";
QTest::newRow("windows path") << "C:\\Program files\\terrible\\name\\of something\\";
QTest::newRow("Plain text") << "Lorem ipsum dolor sit amet.";
QTest::newRow("Escape sequences") << "Lorem\n\t\n\\n\\tAAZ\nipsum dolor\n\nsit amet.";
QTest::newRow("Escape sequences 2") << "\"\n\n\"";
}
void test_PathCombine1()
{
QFETCH(QString, through);
QString there = INIFile::escape(through);
QString back = INIFile::unescape(there);
QCOMPARE(back, through);
}
};
QTEST_GUILESS_MAIN(IniFileTest)
#include "tst_inifile.moc"