qt6-bb10/tests/auto/network/kernel/qhostaddress
Marc Mutz 4077fcc615 QHostAddress: fix assignment operators
QHostAddress allowed assignment from a QString, but the respective
constructor is explicit, and rightfully so. So it does not make
sense that the assignment operator is provided, because of the
asymmetry caused between

   QHostAddress addr = funcReturningQString(); // ERROR
   addr              = funcReturningQString(); // OK (until now)

By the same token, since SpecialAddress is implicitly convertible
to QHostAddress, provide the missing assignment operator from that
enum.

Add tests, rewriting the _data() function to use the enum instead
of an int to pass SpecialAddress values, and to test !=, too.

Added setAddress(SpecialAddress), since a) it was missing and
b) to share code between the ctor and the assignment operator.

Change-Id: Ief64c493be13ada8c6968801d9ed083b267fa902
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-12-07 13:21:20 +00:00
..
.gitignore Moved network autotests into new directory structure 2011-09-09 09:32:17 +02:00
qhostaddress.pro QtNetwork: Remove Windows CE. 2016-03-29 20:28:18 +00:00
tst_qhostaddress.cpp QHostAddress: fix assignment operators 2016-12-07 13:21:20 +00:00