blob: 7e75ce48ae9ee09b2a8aca88d68757d6431170e7 (
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
|
/*********
*
* 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 <QtTest/QtTest>
#include "backend/config/cbtconfig.h"
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);
}
|