From e2b89c5afe57e5881c749e63469cfa8a4ac8ad91 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 22 Jan 2018 14:05:08 +0100 Subject: TextXmlParse: Add truncated-xml testcase #6317 --- test/testxmlparse.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') diff --git a/test/testxmlparse.cpp b/test/testxmlparse.cpp index 9ec675f47..6c0945554 100644 --- a/test/testxmlparse.cpp +++ b/test/testxmlparse.cpp @@ -238,6 +238,40 @@ private slots: QVERIFY(_subdirs.size() == 0); } + void testParserTruncatedXml() { + const QByteArray testXml = "" + "" + "" + "/oc/remote.php/webdav/sharefolder/" + "" + "" + "00004213ocobzus5kn6s" + "RDNVCK" + "121780" + "\"5527beb0400b0\"" + "" + "" + "" + "Fri, 06 Feb 2015 13:49:55 GMT" + "" + "HTTP/1.1 200 OK" + ""; // no proper end here + + + LsColXMLParser parser; + + connect( &parser, SIGNAL(directoryListingSubfolders(const QStringList&)), + this, SLOT(slotDirectoryListingSubFolders(const QStringList&)) ); + connect( &parser, SIGNAL(directoryListingIterated(const QString&, const QMap&)), + this, SLOT(slotDirectoryListingIterated(const QString&, const QMap&)) ); + connect( &parser, SIGNAL(finishedWithoutError()), + this, SLOT(slotFinishedSuccessfully()) ); + + QHash sizes; + QVERIFY(!parser.parse( testXml, &sizes, "/oc/remote.php/webdav/sharefolder" )); + QVERIFY(!_success); + } + void testParserBogfusHref1() { const QByteArray testXml = "" "" -- cgit v1.2.3