summaryrefslogtreecommitdiff
path: root/src/tests/backend/config/cbtconfig_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/backend/config/cbtconfig_test.cpp')
-rw-r--r--src/tests/backend/config/cbtconfig_test.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/tests/backend/config/cbtconfig_test.cpp b/src/tests/backend/config/cbtconfig_test.cpp
new file mode 100644
index 0000000..8fe76d5
--- /dev/null
+++ b/src/tests/backend/config/cbtconfig_test.cpp
@@ -0,0 +1,36 @@
+/*********
+*
+* This file is part of BibleTime's source code, http://www.bibletime.info/.
+*
+* Copyright 1999-2008 by the BibleTime developers.
+* The BibleTime source code is licensed under the GNU General Public License version 2.0.
+*
+**********/
+
+#include "tests/bibletime_test.h"
+
+#include "backend/config/cbtconfig.h"
+
+#include <QtTest/QtTest>
+
+
+void BibleTimeTest::frontend_cbtconfig_test()
+{
+ QList<int> value1;
+ value1 << -1 << 0 << 1 << 993738;
+ QString value1String("-1,0,1,993738");
+ QList<int> emptyValue;
+ QString emptyValueString("");
+
+ //conversion checks int-string
+ QCOMPARE(CBTConfig::IntListToString(value1), value1String);
+ QCOMPARE(CBTConfig::IntListToString(emptyValue), emptyValueString);
+
+ //conversion checks string-int
+ QCOMPARE(CBTConfig::StringToIntList(value1String), value1);
+ QCOMPARE(CBTConfig::StringToIntList(emptyValueString), emptyValue);
+
+ //roundtrip checks
+ QCOMPARE(CBTConfig::StringToIntList(CBTConfig::IntListToString(value1)), value1);
+ QCOMPARE(CBTConfig::StringToIntList(CBTConfig::IntListToString(emptyValue)), emptyValue);
+}