summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tst_QNetworkInterface: enable IPv6 detection for WindowsThiago Macieira2023-08-291-8/+9
| | | | | | | | | | | | | | | | | This was disabled in d0d1d7403377363a101d4f1781d06a9b44787d0a, I guess accidentally, by a too-wide conditional. The change the same commit applied to QtNetworkSettings didn't make the same mistake. I am also opportunistically updating the conditional to QT_CONFIG (I missed this in 9d4579c1cd0aae5f75c8702826b5d874a6aae83e) and adding the Linux-specific check, as the AF_NETLINK implementation does not rely on getifaddrs() or if_nametoindex(). Drive-by fix indentation. Pick-to: 6.6 Change-Id: Ifa1111900d6945ea8e05fffd177ef8fcb11b4e1e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork auto tests: compile with QT_NO_FOREACHAhmad Samir2023-08-221-2/+0
| | | | | | | | | | | | | Remove all "#undef QT_NO_FOREACH" white-listing from source files. Previous commits have removed all remaining Q_FOREACH/foreach uses in this sub-tree. Also remove one source file from NO_PCH_SOURCES in CMakeLists.txt. Task-number: QTBUG-115839 Change-Id: I02cf994eda720c028e613407342fbd6658fa62b1 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork auto tests: port Q_FOREACH to ranged-for [1]Ahmad Samir2023-08-221-6/+8
| | | | | | | | | | | | | The loops were iterating over a temporary, so use a local const auto variable to hold it, and use ranged-for. Drive-by, make the for-loop variable const& instead of copying it, for any object that has a d-pointer (QNetworkAddressEntry, QHostAddress, QNetworkInterface). Task-number: QTBUG-115839 Change-Id: If96c0b2a6142fe2fa2ed45ed7e2435cc1f80e005 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tests: port assorted trivial uses of Q_FOREACH to ranged for loopsMarc Mutz2023-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | All of these fall into the trivial category: loops over (readily made) const local containers. As such, they cannot possibly depend on the safety copy that Q_FOREACH performs, so are safe to port as-is to ranged for loops. There may be more where these came from, but these were the ones that stood out as immediately obvious when scanning the 100s of uses in qtbase, so I preferred to directly fix them over white-listing their files with QT_NO_FOREACH (which still may be necessary for some files, as this patch may not port all uses in that file). Pick-to: 6.6 6.5 Task-nubmber: QTBUG-115839 Change-Id: I7b7893bec8254f902660dac24167113aca855029 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_QNetworkInterface: Update network test server handlingPasi Petäjäjärvi2022-03-301-3/+9
| | | | | | | | | | Adds docker support and makes it no longer skip the whole test if there is no docker or network server. Pick-to: 6.2 6.3 Change-Id: Ie98496df338a804d5c9842cce372e3410fdf9990 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Tests: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: Ibc6a948480a904913a5427e6408d4d296784fb4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Fix check for IPV6 support without certain featuresPasi Petäjäjärvi2022-02-281-3/+8
| | | | | | | | | Without features getifaddrs and ipv6ifname we cannot get correct IPV6 information for interfaces. Pick-to: 6.2 6.3 Change-Id: I7f8c4e68d345160d218fde8db640440f3324014e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+2
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Revert "Fix network tests on qemu/arm"Samuli Piippo2020-12-181-3/+0
| | | | | | | | SIOCGIFNAME is now supported on QEMU. This reverts commit 42b3ed763f989da94a776fd39f9726d2effc5cb1. Change-Id: I79caa371dc798464ab76851d2ea3189ec9eb0c57 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in network testsJarek Kobus2020-06-251-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic96dc8d29b5d720810ca636284f5fd37e4307acd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtNetwork: Delete bearer managementMårten Nordheim2020-04-051-33/+0
| | | | | | | | | | All remaining pieces are gone, configuration included. Relevant CMakeLists and configure.cmake were regenerated. Fixes: QTBUG-76502 Change-Id: I667b5da7e3802830d236d50b5e9190c2ee9c19e2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_QNetworkInterface: don't force an IPv4 link-local addressThiago Macieira2019-12-071-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | Windows apparently has special code to deal with those addresses. If all your network interfaces are up and have acquired addresses, then the link-local network at 169.254.0.0/16 is unreachable. I had never caught this because both my Windows VM and my bare metal Windows have inactive interfaces (like the Bluetooth PAN one) and, when inactive, Windows assigns a link-local address. But in the CI, the interface(s) were all up and running, causing this issue. Unix systems don't treat IPv4 link-local any differently, so they always worked, so long as any interface was up and there had to be one to reach the network test server. This commit reworks the test to add test addresses based on the addresses found on up & running interfaces (see tst_qudpsocket.cpp). For IPv4, we flip the bits in the local portion of the address. For IPv6, we add a node with an address I generated randomly (non-universal), with the same scope. Fixes: QTBUG-65667 Change-Id: I568dea4813b448fe9ba6fffd15dd9f482db34991 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_qnetworkinterface: Fix for case of zero interfaceTuomas Heimonen2018-07-061-0/+2
| | | | | Change-Id: I3e43acf2e96635c39fcb366c8d161a9287af01b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix 5.11 API review findings in QtNetworkFriedemann Kleint2018-03-101-3/+3
| | | | | | | | | | | | Rename QNetworkInterface::maxTransmissionUnit() to QNetworkInterface::maximumTransmissionUnit() Change-Id: I24a80b1317363e8d5da5f251ec908da9a51a6b0a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractSocket: Add socketOption for the Path MTUThiago Macieira2017-11-141-4/+58
| | | | | | | | | | | This allow retrieving the value of the known PMTU for the current socket. This works on Linux (IPv6 and IPv4) and FreeBSD (IPv6 only) -- the other OSes don't have the necessary API. Note: do we need add IP_MTU_DISCOVER? Change-Id: I6e9274c1e7444ad48c81fffd14dcaf97a18ce335 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInterface/Win: fix MTU of Windows loopback interfacesThiago Macieira2017-11-141-0/+2
| | | | | | | | | We document that -1 is not a valid value. The Windows structure's type is unsigned, so the value is actually ULONG_MAX. Change-Id: Ic632b4163d784b83951cfffd14f668645c4da3a9 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInterface: add MTUThiago Macieira2017-11-071-0/+1
| | | | | | | | [ChangeLog][QtNetwork][QNetworkInterface] Added maxTransmissionUnit(). Change-Id: Iaf4157b7efa2416d898cfffd14d96b2970d6af87 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkInterface: Add the DNS eligibilityThiago Macieira2017-11-071-0/+4
| | | | | | | | | [ChangeLog][QtNetwork][QNetworkInterface] Added dnsEligibility() to QNetworkAddressEntry to indicate whether the address is eligible or not for publication in DNS or similar mechanisms. Change-Id: Id3ae5f853d964358ac1ab19b525334a426e0e052 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNetworkInterface: add support for extracting address lifetimeThiago Macieira2017-11-071-0/+16
| | | | | | | | | [ChangeLog][QtNetwork][QNetworkInterface] Added preferredLifetime() and validityLifetime() to QNetworkAddressEntry that report the remaining lifetime of the address in the network interface. Change-Id: I292b84e2193979446e43344b0727642812cba630 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInterface: Add type()Thiago Macieira2017-11-071-0/+1
| | | | | | | | [ChangeLog][QtNetwork][QNetworkInterface] Added type(). Change-Id: I7de033f80b0e4431b7f1ffff13f9a5592b5776e1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* A minor cleanup - fix a commentTimur Pocheptsov2017-10-111-1/+1
| | | | | | | | ... so that it comments the actual code, not what this code was before. Change-Id: Ib191b9d7bd3ae3cda39a15f0f711cb1dd3c5c2b7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Autotest: centralize the detection of IPv6 supportThiago Macieira2017-09-251-12/+12
| | | | | | | I'll need it again in the next commit. Change-Id: I209fcd5dbc2b4e5381cffffd14df65dcee71ca7e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Autotest: use QUdpSocket instead of QTcpSocket in tst_QNetworkInterfaceThiago Macieira2017-09-141-7/+2
| | | | | | | | | | | | | We don't need to bother the network test server with a TCP SYN packet. All we need is for the local operating system to figure out the IP address it would use to send a packet to the test server. We can do that with QUdpSocket. Also, the network test server hasn't been called "fluke.troll.no" for almost a decade. Change-Id: I209fcd5dbc2b4e5381cffffd14df65ccc7133247 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix network tests on qemu/armSami Nurmenniemi2017-04-061-0/+3
| | | | | | | | Function if_indextoname fails on qemu because SIOCGIFNAME is not supported. Expect failure if emulation is detected. Change-Id: I53b41286d82458661e7fa723af385f323582ce7e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-7/+0
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| * Autotest: remove the check that broadcast = ip | ~netmaskThiago Macieira2016-01-211-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | It's possible to configure an interface so that it isn't the case. I have no idea if this is a valid scenario, but the unit test shouldn't enforce that. ip addr can report: inet 192.168.1.1/32 brd 192.168.1.255 scope global vlan0 valid_lft forever preferred_lft forever Change-Id: I8de47ed6c7be4847b99bffff141c337575760bd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | | | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-181-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/painting.pri src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro tests/auto/corelib/tools/qlocale/test/test.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp tools/configure/environment.cpp Change-Id: I9c40f458b89b2c206de2d2c24e90b5f679c93495
| * QNetworkInterface: fix support for address labels on Linux interfacesThiago Macieira2015-12-081-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64a1448d87727878d9789906b2f4f5b9e3d74e38 (Qt 5.2) caused QNetworkInterface to report address labels (a.k.a. interface aliases) as separate interfaces. This is caused by the fact that glibc, uClibc and MUSL copy the address label (netlink address attribute IFA_LABEL) to the ifa_name field, which made QNetworkInterfaceManager think that it was an interface it hadn't yet seen. Address labels are the old way to add more than one IP address to an interface on Linux, for example: ifconfig eth0:1 192.0.2.2 Those do not create a new interface, so the "eth0:1" label maps to the same interface index as the parent interface. This has been deprecated for 10 years, but there are still tools out there that add addresses in this manner. This commit restores behavior compatibility with Qt 4.2-5.1. The Qt 5.2-5.5 behavior is incorrect because it reports more than one interface with the same index. On systems configured like the above, the tst_QNetworkInterface::interfaceFromXXX test was failing. Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329 Reviewed-by: Richard J. Moore <rich@kde.org>
* | Add QNetworkInterface::interface{IndexFromName,NameFromIndex}Thiago Macieira2015-10-151-0/+5
| | | | | | | | | | | | | | | | | | | | These are for faster lookups between ID and name when one doesn't need the full information set about the interface. Change-Id: I7de033f80b0e4431b7f1ffff13f98d448a705c3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
|/ | | | | | | Use character literals where applicable. Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Autotest: Make tst_QNetworkInterface::interfaceFromXXX data-drivenThiago Macieira2015-09-131-20/+28
| | | | | Change-Id: I7de033f80b0e4431b7f1ffff13f98c015ae37dc6 Reviewed-by: Richard J. Moore <rich@kde.org>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QNetworkInterface auto test: do not abort without sessionPeter Hartmann2013-03-261-5/+8
| | | | | | | ... but only if the QNetworkConfiguration manager requires one. Change-Id: I1c69c43438f1df9080d207c8598a42201f759c5b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* test: Don't fail if the network test server is not set upSergio Ahumada2012-10-251-1/+2
| | | | | | | | Not having access to a network test server is not a failure per se but rather an enviromental condition not met at run-time. Change-Id: Ie7d10ca5fbf2df45fb1fd1ac19718c9fae855c03 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed build break when bearer is disabled.Xizhi Zhu2012-01-161-1/+3
| | | | | Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-2/+0
| | | | | | | | | 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>
* Fix sanity check of network test serverJason McDonald2011-11-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Moved network autotests into new directory structureJo Asplin2011-09-091-0/+241
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>