diff options
Diffstat (limited to 'example')
| -rw-r--r-- | example/tests/tests.cpp | 27 | ||||
| -rw-r--r-- | example/tests/tests.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/example/tests/tests.cpp b/example/tests/tests.cpp index 8125e5c3..86c6d4c9 100644 --- a/example/tests/tests.cpp +++ b/example/tests/tests.cpp @@ -383,6 +383,33 @@ void TestXmlRpc::testString() QByteArray("<value><string>hello world</string></value>")); } +void TestXmlRpc::testArray() +{ + checkVariant(QVariantList() << QString("hello world") << double(-12.214), + QByteArray("<value><array><data>" + "<value><string>hello world</string></value>" + "<value><double>-12.214</double></value>" + "</data></array></value>")); +} + +void TestXmlRpc::testStruct() +{ + QMap<QString, QVariant> map; + map["bar"] = QString("hello world"); + map["foo"] = double(-12.214); + checkVariant(map, + QByteArray("<value><struct>" + "<member>" + "<name>bar</name>" + "<value><string>hello world</string></value>" + "</member>" + "<member>" + "<name>foo</name>" + "<value><double>-12.214</double></value>" + "</member>" + "</struct></value>")); +} + int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); diff --git a/example/tests/tests.h b/example/tests/tests.h index 1edaf8bb..d7367628 100644 --- a/example/tests/tests.h +++ b/example/tests/tests.h @@ -70,4 +70,7 @@ private slots: void testDouble(); void testInt(); void testString(); + + void testArray(); + void testStruct(); }; |
