summaryrefslogtreecommitdiffstats
path: root/tests/tst_inifile.cpp
blob: c0f57c122f3dada217716fd4e9f7a51f292a7563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <QTest>
#include "TestUtil.h"

#include "depends/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_MULTIMC(IniFileTest)

#include "tst_inifile.moc"