aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 15:54:01 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-08-09 15:54:01 +0000
commit04298058cd84d2e2f1b53fa2e032dddf480259f2 (patch)
treed61a0c22d6aa2bdfb1afedd861c698b147bf0875 /example
parent98cfcdaecad0fec2bb026f7cafe06491f1765c2e (diff)
downloadqxmpp-04298058cd84d2e2f1b53fa2e032dddf480259f2.tar.gz
test int & base64
Diffstat (limited to 'example')
-rw-r--r--example/tests/tests.cpp12
-rw-r--r--example/tests/tests.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/example/tests/tests.cpp b/example/tests/tests.cpp
index b8ab9c63..8125e5c3 100644
--- a/example/tests/tests.cpp
+++ b/example/tests/tests.cpp
@@ -344,6 +344,12 @@ static void checkVariant(const QVariant &value, const QByteArray &xml)
QCOMPARE(test, value);
}
+void TestXmlRpc::testBase64()
+{
+ checkVariant(QByteArray("\0\1\2\3", 4),
+ QByteArray("<value><base64>AAECAw==</base64></value>"));
+}
+
void TestXmlRpc::testBool()
{
// FIXME : XML-RPC spec says we should write "0" or "1"
@@ -365,6 +371,12 @@ void TestXmlRpc::testDouble()
QByteArray("<value><double>-12.214</double></value>"));
}
+void TestXmlRpc::testInt()
+{
+ checkVariant(int(-12),
+ QByteArray("<value><i4>-12</i4></value>"));
+}
+
void TestXmlRpc::testString()
{
checkVariant(QString("hello world"),
diff --git a/example/tests/tests.h b/example/tests/tests.h
index 1a536ffc..1edaf8bb 100644
--- a/example/tests/tests.h
+++ b/example/tests/tests.h
@@ -64,8 +64,10 @@ class TestXmlRpc : public QObject
Q_OBJECT
private slots:
+ void testBase64();
void testBool();
void testDateTime();
void testDouble();
+ void testInt();
void testString();
};