aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qcoapclient/tst_qcoapclient.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-05-09 18:01:35 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-05-14 15:14:33 +0000
commit804b10f3297822f4b12a4b971633f78965b756b0 (patch)
tree2eee142aaf317e74ca66eb96c535cffd461fca5e /tests/auto/qcoapclient/tst_qcoapclient.cpp
parent18289e7c1d2778460dccb1135fe283bd234954ad (diff)
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 <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qcoapclient/tst_qcoapclient.cpp')
-rw-r--r--tests/auto/qcoapclient/tst_qcoapclient.cpp19
1 files changed, 19 insertions, 0 deletions
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<QHostAddress>(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<QHostAddress>(spyMulticastResponse.at(1).at(2));
QCOMPARE(sender1, host1);
+#else
+ QSKIP("Not an internal build, skipping this test");
+#endif
}
QTEST_MAIN(tst_QCoapClient)