From 804b10f3297822f4b12a4b971633f78965b756b0 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Thu, 9 May 2019 18:01:35 +0200 Subject: Hide the APIs of QCoapConnection and QCoapQUdpConnection At the moment only the QCoapQUdpConnection class implements the QCoapConnection interface. If later we decide to add other implementations, and it turns out that the current API is not good enough, it won't be possible to change it without breaking the source compatibility. Let's make these classes private, we can make them public when there is a need for it. Change-Id: I41336dda0e6eaa762f0eb9c8f4aa98a9c7b62a2c Reviewed-by: Simon Hausmann --- tests/auto/qcoapclient/tst_qcoapclient.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/auto/qcoapclient/tst_qcoapclient.cpp') diff --git a/tests/auto/qcoapclient/tst_qcoapclient.cpp b/tests/auto/qcoapclient/tst_qcoapclient.cpp index 3e5eac0..90b44cf 100644 --- a/tests/auto/qcoapclient/tst_qcoapclient.cpp +++ b/tests/auto/qcoapclient/tst_qcoapclient.cpp @@ -77,6 +77,8 @@ private Q_SLOTS: void multicast_blockwise(); }; +#ifdef QT_BUILD_INTERNAL + class QCoapQUdpConnectionSocketTestsPrivate : public QCoapQUdpConnectionPrivate { bool bind() override @@ -172,6 +174,7 @@ public: } }; +#endif class Helper : public QObject { @@ -347,6 +350,7 @@ void tst_QCoapClient::setBlockSize_data() void tst_QCoapClient::setBlockSize() { +#ifdef QT_BUILD_INTERNAL QFETCH(int, blockSizeSet); QFETCH(int, blockSizeExpected); @@ -358,6 +362,9 @@ void tst_QCoapClient::setBlockSize() eventLoop.exec(); QCOMPARE(client.protocol()->blockSize(), blockSizeExpected); +#else + QSKIP("Not an internal build, skipping this test"); +#endif } void tst_QCoapClient::requestWithQIODevice_data() @@ -479,6 +486,7 @@ void tst_QCoapClient::timeout_data() void tst_QCoapClient::timeout() { +#ifdef QT_BUILD_INTERNAL QFETCH(int, timeout); QFETCH(int, maxRetransmit); @@ -520,6 +528,9 @@ void tst_QCoapClient::timeout() QCOMPARE(spyReplyFinished.count(), 1); QCOMPARE(spyReplyAborted.count(), 0); QCOMPARE(spyClientError.count(), 1); +#else + QSKIP("Not an internal build, skipping this test"); +#endif } void tst_QCoapClient::abort() @@ -786,6 +797,7 @@ void tst_QCoapClient::confirmableMulticast() void tst_QCoapClient::multicast() { +#ifdef QT_BUILD_INTERNAL QCoapClientForMulticastTests client; QCoapRequest request = QCoapRequest(QUrl("224.0.1.187")); request.setToken("abc"); @@ -811,10 +823,14 @@ void tst_QCoapClient::multicast() QCOMPARE(message1.payload(), "Reply1"); QHostAddress sender1 = qvariant_cast(spyMulticastResponse.at(1).at(2)); QCOMPARE(sender1, host1); +#else + QSKIP("Not an internal build, skipping this test"); +#endif } void tst_QCoapClient::multicast_blockwise() { +#ifdef QT_BUILD_INTERNAL QCoapClientForMulticastTests client; QCoapRequest request = QCoapRequest(QUrl("224.0.1.187")); request.setToken("abc"); @@ -842,6 +858,9 @@ void tst_QCoapClient::multicast_blockwise() QCOMPARE(message1.payload(), "Reply3Reply4"); QHostAddress sender1 = qvariant_cast(spyMulticastResponse.at(1).at(2)); QCOMPARE(sender1, host1); +#else + QSKIP("Not an internal build, skipping this test"); +#endif } QTEST_MAIN(tst_QCoapClient) -- cgit v1.2.3