From 0ed84be38b159a32790cb074dc04760313ba27c2 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Wed, 18 Jul 2012 10:26:59 +0200 Subject: Fix and test data form title/instructions XML serialization. --- tests/tests.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/tests.cpp') diff --git a/tests/tests.cpp b/tests/tests.cpp index f824b938..223aecd9 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -962,6 +962,31 @@ void TestCodec::testTheoraEncoder() #endif } +void TestDataForm::testSimple() +{ + const QByteArray xml( + "" + "Search" + "Fill out this form to search for information!" + "" + "" + "" + "" + ""); + + QXmppDataForm form; + parsePacket(form, xml); + + QCOMPARE(form.isNull(), false); + QCOMPARE(form.instructions(), QString("Fill out this form to search for information!")); + QCOMPARE(form.fields().size(), 1); + QCOMPARE(form.fields().at(0).type(), QXmppDataForm::Field::TextSingleField); + QCOMPARE(form.fields().at(0).isRequired(), true); + QCOMPARE(form.fields().at(0).key(), QString("search_request")); + + serializePacket(form, xml); +} + void TestJingle::testSession() { const QByteArray xml( @@ -1805,6 +1830,9 @@ int main(int argc, char *argv[]) TestCodec testCodec; errors += QTest::qExec(&testCodec); + TestDataForm testDataForm; + errors += QTest::qExec(&testDataForm); + TestJingle testJingle; errors += QTest::qExec(&testJingle); -- cgit v1.2.3