From a6cb69085975352f10dcf8e6c93c6470ac9c459e Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 6 Aug 2010 09:36:33 +0200 Subject: test that joining invalid group fails, make test data names more verbose when testing the ttl and loopback socket options, include the bind address as part of the test data name --- tests/auto/qudpsocket/tst_qudpsocket.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index 7938afa..32fab6b 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -869,12 +869,12 @@ void tst_QUdpSocket::multicastTtlOption_data() addresses += QHostAddress(QHostAddress::AnyIPv6); foreach (const QHostAddress &address, addresses) { - QTest::newRow("0") << address << 0 << 0; - QTest::newRow("1") << address << 1 << 1; - QTest::newRow("2") << address << 2 << 2; - QTest::newRow("128") << address << 128 << 128; - QTest::newRow("255") << address << 255 << 255; - QTest::newRow("1024") << address << 1024 << 1; + QTest::newRow(QString("%1 0").arg(address.toString()).toAscii()) << address << 0 << 0; + QTest::newRow(QString("%1 1").arg(address.toString()).toAscii()) << address << 1 << 1; + QTest::newRow(QString("%1 2").arg(address.toString()).toAscii()) << address << 2 << 2; + QTest::newRow(QString("%1 128").arg(address.toString()).toAscii()) << address << 128 << 128; + QTest::newRow(QString("%1 255").arg(address.toString()).toAscii()) << address << 255 << 255; + QTest::newRow(QString("%1 1024").arg(address.toString()).toAscii()) << address << 1024 << 1; } } @@ -907,13 +907,13 @@ void tst_QUdpSocket::multicastLoopbackOption_data() addresses += QHostAddress(QHostAddress::AnyIPv6); foreach (const QHostAddress &address, addresses) { - QTest::newRow("0") << address << 0 << 0; - QTest::newRow("1") << address << 1 << 1; - QTest::newRow("2") << address << 2 << 1; - QTest::newRow("0 again") << address << 0 << 0; - QTest::newRow("2 again") << address << 2 << 1; - QTest::newRow("0 last time") << address << 0 << 0; - QTest::newRow("1 again") << address << 1 << 1; + QTest::newRow(QString("%1 0").arg(address.toString()).toAscii()) << address << 0 << 0; + QTest::newRow(QString("%1 1").arg(address.toString()).toAscii()) << address << 1 << 1; + QTest::newRow(QString("%1 2").arg(address.toString()).toAscii()) << address << 2 << 1; + QTest::newRow(QString("%1 0 again").arg(address.toString()).toAscii()) << address << 0 << 0; + QTest::newRow(QString("%1 2 again").arg(address.toString()).toAscii()) << address << 2 << 1; + QTest::newRow(QString("%1 0 last time").arg(address.toString()).toAscii()) << address << 0 << 0; + QTest::newRow(QString("%1 1 again").arg(address.toString()).toAscii()) << address << 1 << 1; } } @@ -1031,8 +1031,10 @@ void tst_QUdpSocket::multicast_data() QTest::addColumn("groupAddress"); QTest::addColumn("joinResult"); QTest::newRow("valid bind, group ipv4 address") << anyAddress << true << groupAddress << true; + QTest::newRow("valid bind, invalid group ipv4 address") << anyAddress << true << anyAddress << false; QTest::newRow("same bind, group ipv4 address") << groupAddress << true << groupAddress << true; QTest::newRow("valid bind, group ipv6 address") << any6Address << true << group6Address << true; + QTest::newRow("valid bind, invalid group ipv6 address") << any6Address << true << any6Address << false; QTest::newRow("same bind, group ipv6 address") << group6Address << true << group6Address << true; } -- cgit v0.12