Commit e404ba9d authored by hjk's avatar hjk

PortGatherer: Add test for Mac's netstat output.

Change-Id: I6df357502e5621e858a848c567fe1590762d5fc1
Reviewed-by: default avatarFilipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 2ebd51fc
......@@ -233,6 +233,16 @@ void tst_StringUtils::testParseUsedPortFromNetstatOutput_data()
// Linux
QTest::newRow("Linux1") << "sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt ..." << -1;
QTest::newRow("Linux2") << "0: 00000000:2805 00000000:0000 0A 00000000:00000000 00:00000000 00000000 ..." << 10245;
// Mac
QTest::newRow("Mac1") << "Active Internet connections (including servers)" << -1;
QTest::newRow("Mac2") << "Proto Recv-Q Send-Q Local Address Foreign Address (state)" << -1;
QTest::newRow("Mac3") << "tcp4 0 0 192.168.1.12.55687 88.198.14.66.443 ESTABLISHED" << 55687;
QTest::newRow("Mac4") << "tcp6 0 0 2a01:e34:ee42:d0.55684 2a02:26f0:ff::5c.443 ESTABLISHED" << 55684;
QTest::newRow("Mac5") << "tcp4 0 0 *.631 *.* LISTEN" << 631;
QTest::newRow("Mac6") << "tcp6 0 0 *.631 *.* LISTEN" << 631;
QTest::newRow("Mac7") << "udp4 0 0 192.168.79.1.123 *.*" << 123;
QTest::newRow("Mac9") << "udp4 0 0 192.168.8.1.123 *.*" << 123;
}
QTEST_MAIN(tst_StringUtils)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment