From 771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Thu, 14 Apr 2016 01:23:54 +0200 Subject: NOISSUE reorganize unit tests to be placed next to the code they test. Nuke more dead tests. --- tests/tst_inifile.cpp | 62 --------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tests/tst_inifile.cpp (limited to 'tests/tst_inifile.cpp') diff --git a/tests/tst_inifile.cpp b/tests/tst_inifile.cpp deleted file mode 100644 index 2c3d8103..00000000 --- a/tests/tst_inifile.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include "TestUtil.h" - -#include "settings/INIFile.h" - -class IniFileTest : public QObject -{ - Q_OBJECT -private -slots: - void initTestCase() - { - - } - void cleanupTestCase() - { - - } - - void test_Escape_data() - { - QTest::addColumn("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_Escape() - { - QFETCH(QString, through); - - QString there = INIFile::escape(through); - QString back = INIFile::unescape(there); - - QCOMPARE(back, through); - } - - void test_SaveLoad() - { - QString a = "a"; - QString b = "a\nb\t\n\\\\\\C:\\Program files\\terrible\\name\\of something\\"; - QString filename = "test_SaveLoad.ini"; - - // save - INIFile f; - f.set("a", a); - f.set("b", b); - f.saveFile(filename); - - // load - INIFile f2; - f2.loadFile(filename); - QCOMPARE(a, f2.get("a","NOT SET").toString()); - QCOMPARE(b, f2.get("b","NOT SET").toString()); - } -}; - -QTEST_GUILESS_MAIN(IniFileTest) - -#include "tst_inifile.moc" -- cgit