tests/auto/qxmlquery/tst_qxmlquery.cpp
changeset 22 79de32ba3296
parent 18 2f34d5167611
child 30 5dc02b23752f
equal deleted inserted replaced
19:fcece45ef507 22:79de32ba3296
  2038 
  2038 
  2039     if(!m_testNetwork)
  2039     if(!m_testNetwork)
  2040         return;
  2040         return;
  2041 
  2041 
  2042     QTest::newRow("http scheme")
  2042     QTest::newRow("http scheme")
  2043         << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/wellFormed.xml"))
  2043         << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/wellFormed.xml"))
  2044         << QByteArray("<!-- a comment --><e from=\"http\">Some Text</e>");
  2044         << QByteArray("<!-- a comment --><e from=\"http\">Some Text</e>");
  2045 
  2045 
  2046     QTest::newRow("ftp scheme")
  2046     QTest::newRow("ftp scheme")
  2047         << QUrl(QString("ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/wellFormed.xml"))
  2047         << QUrl(QString("ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/wellFormed.xml"))
  2048         << QByteArray("<!-- a comment --><e from=\"ftp\">Some Text</e>");
  2048         << QByteArray("<!-- a comment --><e from=\"ftp\">Some Text</e>");
  2101 
  2101 
  2102     if(!m_testNetwork)
  2102     if(!m_testNetwork)
  2103         return;
  2103         return;
  2104 
  2104 
  2105     QTest::newRow("http scheme, not well-formed")
  2105     QTest::newRow("http scheme, not well-formed")
  2106         << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/notWellformed.xml"));
  2106         << QUrl(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/notWellformed.xml"));
  2107 
  2107 
  2108     QTest::newRow("https scheme, not well-formed")
  2108     QTest::newRow("https scheme, not well-formed")
  2109         << QUrl(QString("https://" + QtNetworkSettings::serverName() + "/qxmlquery/notWellformedViaHttps.xml"));
  2109         << QUrl(QString("https://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/notWellformedViaHttps.xml"));
  2110 
  2110 
  2111     QTest::newRow("https scheme, nonexistent host")
  2111     QTest::newRow("https scheme, nonexistent host")
  2112         << QUrl(QLatin1String("https://this.host.does.not.exist.I.SWear"));
  2112         << QUrl(QLatin1String("https://this.host.does.not.exist.I.SWear"));
  2113 
  2113 
  2114     QTest::newRow("ftp scheme, nonexistent host")
  2114     QTest::newRow("ftp scheme, nonexistent host")
  2562     QTest::newRow("A valid query via the ftp scheme")
  2562     QTest::newRow("A valid query via the ftp scheme")
  2563         << QUrl::fromEncoded(QString("ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/viaFtp.xq").toLatin1())
  2563         << QUrl::fromEncoded(QString("ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/viaFtp.xq").toLatin1())
  2564         << QByteArray("This was received via FTP");
  2564         << QByteArray("This was received via FTP");
  2565 
  2565 
  2566     QTest::newRow("A valid query via the http scheme")
  2566     QTest::newRow("A valid query via the http scheme")
  2567         << QUrl::fromEncoded(QString("http://" + QtNetworkSettings::serverName() + "/qxmlquery/viaHttp.xq").toLatin1())
  2567         << QUrl::fromEncoded(QString("http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/viaHttp.xq").toLatin1())
  2568         << QByteArray("This was received via HTTP.");
  2568         << QByteArray("This was received via HTTP.");
  2569 }
  2569 }
  2570 
  2570 
  2571 void tst_QXmlQuery::setQueryQUrlFailSucceed() const
  2571 void tst_QXmlQuery::setQueryQUrlFailSucceed() const
  2572 {
  2572 {
  2628         << QUrl::fromEncoded("ftp://example.com/NoQuery/ISWear");
  2628         << QUrl::fromEncoded("ftp://example.com/NoQuery/ISWear");
  2629         */
  2629         */
  2630 
  2630 
  2631     QTest::newRow("A query via http:// that is completely empty, but readable.")
  2631     QTest::newRow("A query via http:// that is completely empty, but readable.")
  2632         << QUrl::fromEncoded(QString(
  2632         << QUrl::fromEncoded(QString(
  2633                 "http://" + QtNetworkSettings::serverName() + "/qxmlquery/completelyEmptyQuery.xq").toLatin1());
  2633                 "http://" + QtNetworkSettings::serverName() + "/qtest/qxmlquery/completelyEmptyQuery.xq").toLatin1());
  2634 
  2634 
  2635     QTest::newRow("A query via ftp:// that is completely empty, but readable.")
  2635     QTest::newRow("A query via ftp:// that is completely empty, but readable.")
  2636         << QUrl::fromEncoded(QString(
  2636         << QUrl::fromEncoded(QString(
  2637                 "ftp://" + QtNetworkSettings::serverName() + "qxmlquery/completelyEmptyQuery.xq").toLatin1());
  2637                 "ftp://" + QtNetworkSettings::serverName() + "/pub/qxmlquery/completelyEmptyQuery.xq").toLatin1());
  2638 
  2638 
  2639 }
  2639 }
  2640 
  2640 
  2641 void tst_QXmlQuery::setQueryQUrlBaseURI() const
  2641 void tst_QXmlQuery::setQueryQUrlBaseURI() const
  2642 {
  2642 {