Commit Graph

33 Commits

Author SHA1 Message Date
Jason McDonald
5635823e17 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I311e001373776812699d6efc045b5f742890c689
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 03:54:59 +01:00
Kurt Korbatits
746c148c95 Changed qnetworkdiskcache unittest to cleanup test directory.
- Remove foo directory tree after run.

Change-Id: I2d554b4c64fc7162c7717c840534cf77f5e744d0
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-24 06:59:21 +01:00
Jason McDonald
629d6eda5c Update contact information in license headers.
Replace Nokia contact email address with Qt Project website.

Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-23 04:04:33 +01:00
Xizhi Zhu
5b1aa4c75d Fixed build break when bearer is disabled.
Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-16 11:29:04 +01:00
Jonas M. Gastal
bdce610022 Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.
This is a fix for problems introduced by bf7f170.

Change-Id: If5dd8e031ef2efea578b3efb188c2e950e1ba41a
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-13 20:55:00 +01:00
Jonas M. Gastal
14b929e9c4 Cleaning up header includes.
QNetworkCookie doesn't need to know about QNetworkCookieJar and for
QNetworkCookieJar header a forward declared QNetworkCookie is enough.

Change-Id: I21145ce0f67a0a6bd68a46a5e757f82105cdf520
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-13 20:54:23 +01:00
Jonas M. Gastal
1453f74cc5 Make QFtp private.
All references to QFtp in documentation have been removed, QFtp's
documentaiton was marked internal. The QFtp example was removed.

Task-number: QTBUG-23199
Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-01-12 14:38:55 +01:00
Stephen Kelly
7acac24869 Avoid using check as an identifier.
Avoids conflict with Mac OS.

Change-Id: I64856a64808dcd481f6075eb4f3a7cc19950bad3
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-10 01:44:24 +01:00
Jonas M. Gastal
b3ce4470ae Removing QHttp class, its tests and its usage in examples.
Task-number: QTBUG-22750
Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-06 23:07:26 +01:00
Sami Rosendahl
e6b9382ae2 Add regression test for QTBUG-22660
QHttpNetworkReply crashed in Qt4.7 and 4.8 if a HTTP server responded with
gzip-encoded empty content without defining Content-Length in the response
header. This commit adds the test for the problem as a regression test to
Qt5.

Change-Id: Iddfb970a31d92a66fd1dd524811cf54bb06e5157
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-06 04:43:05 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Jason McDonald
fda36df6ba Use true and false in preference to TRUE and FALSE in tests.
Use the C++ boolean constants true and false instead of the C macros
TRUE and FALSE (which are actually integers), and use QVERIFY instead of
QCOMPARE for verifying simple boolean expressions.

Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-03 02:57:12 +01:00
Jason McDonald
9fe76bf6a6 Remove mention of Trolltech in QHttp autotest.
The data file named "trolltech" has nothing specific to Trolltech in its
contents.  Rename it to "testhtml".  The lack of a file extension is
intentional.

Task-number: QTBUG-19653
Change-Id: Idc5c5f4ffa447151e47f66ff7364f0fa8753a699
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 02:56:02 +01:00
Peter Hartmann
1ddecb0aa2 network auto tests: add QNetworkReply test for pipelining
Reviewed-by: Markus Goetz
Task-number: QTBUG-21369
(cherry picked from commit a32bfdef6d6b45c916f143dcf8495a2e102c3eec)

Change-Id: Iecde23c56f128008c5172675601928d83180358a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Shane Kearns
4954f71648 Fix http authentication to a different realm on the same server
This is a regression caused by the NTLMv2 authentication patch.
I have manually tested NTLMv2 authentication against MS IIS and reverting
these two lines does not break it.

Task-number: QT-5209
Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 16:10:33 +01:00
Shane Kearns
4be2430925 Test case for QTBUG-22875
Test the authentication cache works properly with "cancelled dialogs"
or if the user enters username/password incorrectly.
Expected behaviour is based on web browsers:
If cancelled, current request fails, and prompt again the next time.
If wrong password is given, prompt again and retry the current request.
If bad credentials are in the cache, prompt again

Task-number: QTBUG-22875
Change-Id: Ic02ccac8dbeb3f2580ca4ffe47d0773982c4ab25
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 06:02:32 +01:00
Shane Kearns
0443a51228 Fix QNetworkReply test cases that use the MiniHttpServer on windows
The "happy eyeballs" connection code means that IPv4 and IPv6 connections
are both attempted for a http request.
For a normal http server, this is no problem, but the MiniHttpServer in
the test code is very simplistic and cannot cope with more than one
client connected at the same time.
On windows this causes all these tests to fail with timeouts.
Changed the MiniHttpServer to listen on IPv4 only instead of Any address.

Change-Id: I81e249997d894d266001da474a351b1f5642599e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-19 19:08:57 +01:00
Jason McDonald
e3640d1bdd Remove TESTED_CLASS/TESTED_FILES comments from tests.
These comments were mostly empty or inaccurate.  Appropriate naming of
tests and appropriate placement of tests within the directory tree
provide more reliable indicators of what is being tested.

Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-06 02:19:25 +01:00
Jason McDonald
e15548d3e4 Fix sanity check of network test server
Some of Qt's autotests depend on access to a test server.  For each test
that used the test server, tests/auto/network-settings.h created a
global object to verify at startup that host lookups to the test server
will succeed (and abort the test otherwise).

There are two problems with that approach:

First, the sanity check happens before main(), and thus before the test
framework has started logging test results.  This means that if the
sanity check aborts the test, the failure message will not be visible in
the test output if logging to a file or will cause the output to be
malformed if logging to the console in XML format.

Second, since Qt 4.7, the host lookup uses a class that connects to the
QCoreApplication instance, which doesn't exist before main(), and this
caused all tests that included network-settings.h to output an error
message from QObject::connect() at the beginning of the test.

Both of these problems are solved by removing the global object from
network-settings.h and instead performing the sanity check in the
initTestCase() function of each test.

Task-number: QTBUG-22876
Change-Id: Id49c1826906327bf571686cc11527f0265e5af44
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-28 08:13:41 +01:00
Jason McDonald
a8fd0c3654 Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.

This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
    924d810dbd
    8aaff67510
    338d3f1197
    a55034062b
    253497b744
    7cfad460c5
    9d2ff58f36
    0cf6baa2d6

Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-11-18 01:51:57 +01:00
Olivier Goffart
a4f446704e QNAM: Fix authentication cache when the password is in the URL
Two problems:
 - The signal cacheCredidentials was not connected in the synchronous
   case while it must be connected. (Regression when the threaded http
   was merged)
 - We cannot cache the credidentials when we proceed the url because
   at that point, we do not know the realm (this basically reverts
   9bc5a32b875b812c3a706034c8c27614f86bd138)

Task-number: QTBUG-18411

Change-Id: I8ea11fa23db4314c3f17ed06d2d7f9ee934ccdba
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-11-08 17:20:39 +01:00
Friedemann Kleint
735457a40b Remove remains of qpa in tests.
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>

Change-Id: I41aed5290df5aebeb30ebf5d2796aca6c65980d1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-11-01 16:15:08 +01:00
Jo Asplin
2f4a95d24d Re-enabled tst_qhttpnetworkconnection
tst_qhttpnetworkconnection is fixed by 13df02ad04

Task-number: QTBUG-20981
Change-Id: I5666dbafe09113a7ecc3680f7608f874d66e2c19
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-26 00:43:11 +02:00
Shane Kearns
ba995c372c QNetworkReply autotest no longer needs private_tests
Due to clearAccessCache being made part of the public API in Qt5,
this autotest can be run on normal Qt builds again

Task-number: QTBUG-17312
Change-Id: I3b70237a28ed141ffb49762cc40c8a528f9be6a8
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-10-25 12:53:46 +02:00
Rohan McGovern
d04bf8f407 all remaining tests: eliminated usage of qttest_p4.prf
qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4.
It enables various crufty undocumented magic, of dubious value.
Stop using it, and explicitly enable the things from it which we want.

Change-Id: I02fe27b2c1800f929250fa8694ca2976c9661a12
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-10-25 08:42:23 +02:00
Jason McDonald
27f9f136f7 Remove SkipMode parameter from QSKIP calls.
The previous commit removed SkipMode from the testlib APi.  This commit
removes the parameter from all calls to QSKIP.

Task-number: QTBUG-21851, QTBUG-21652
Change-Id: I21c0ee6731c1bc6ac6d962590d9b31d7459dfbc5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-21 01:20:29 +02:00
Jason McDonald
8f02339e76 Remove DEPENDS_ON from qtestlib API.
The DEPENDS_ON macro didn't do anything and has misled many users to
think that they can write test functions that depend on other test
functions.

Task-number: QTBUG-21851
Change-Id: Ibe65b2d5d88bb81b6a0ebbe0b220f7d409a1446c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:24:13 +02:00
Jason McDonald
ae1810658b Move QTRY_VERIFY/QTRY_COMPARE into testlib.
These functions have lived in tests/shared/util.h for a long time, but
they really belong in qtestlib.

Change-Id: I60d569d002dea220b51563931d8b7aa77a20b98b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-19 07:23:44 +02:00
Shane Kearns
f43ca8d4e7 fix tst_QNetworkReply::headFromHttp failure
The reference file has suffered whitespace changes during the cherry
pick from 4.8. Refetched from the test server.

Change-Id: I03a0b7a66cf6743de3391905422b2f4cdcd86dcf
Reviewed-on: http://codereview.qt-project.org/6454
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-10-12 18:01:19 +02:00
Shane Kearns
cb2e618127 Create auto test for http HEAD request
This is in order to have a regression test for QT-5304.
However the test is also checking basic functionality of head
requests too.

Task-Number: QT-5304
Change-Id: I0d98bd1f1125ffd49d9f3c859a51b2aaee95379a
Reviewed-By: Martin Petersson
Reviewed-on: http://codereview.qt-project.org/6033
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2011-10-06 11:24:20 +02:00
Jason McDonald
9d2ff58f36 Avoid using QSKIP in lieu of compile-time checks
QSKIP is intended to be used to skip test functions that are found at
run-time to be inapplicable or unsafe.  If a test function can be
determined to be inapplicable at compile-time, the entire test function
should be omitted instead of replacing the body of the test function
with a QSKIP, which only serves to slow down test runs and to inflate
test run-rates with empty, inapplicable tests.

Task-number: QTQAINFRA-278

Change-Id: I21664d8d92b27c26c64789fc08d0ec7b8988456a
Reviewed-on: http://codereview.qt-project.org/5941
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-10-04 06:01:38 +02:00
Jason McDonald
95cebd34eb Remove Symbian-specific code from tests.
Symbian is not a supported platform for Qt5, so this code is no longer
required.

Change-Id: I1172e6a42d518490e63e9599bf10579df08259aa
Reviewed-on: http://codereview.qt-project.org/5657
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-29 06:41:42 +02:00
Jo Asplin
c59f9ad776 Moved network autotests into new directory structure
Task-number: QTBUG-21223

Change-Id: I55dbf5c42a1c5d938b9e0c9bf7d90457a6c26bbc
Reviewed-on: http://codereview.qt-project.org/4259
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-09-09 09:32:17 +02:00