diff options
author | Dimitrios Apostolou <jimis@qt.io> | 2020-05-20 12:26:16 +0200 |
---|---|---|
committer | Dimitrios Apostolou <jimis@qt.io> | 2020-05-28 10:48:58 +0200 |
commit | b37cf68810f01364297d2bc15643a32f23fca5f5 (patch) | |
tree | 221630031080a96123798af5b7a0095123d59d20 | |
parent | bc58e0dc7a378d96472441757250586b71868e62 (diff) |
Add tests for a couple of edge cases
Change-Id: I1cd799cc671fa2191e20d4681632588dc79e98dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r-- | tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp index fe2e651a03..10d7aa20f8 100644 --- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp +++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp @@ -37,6 +37,7 @@ #include <QtNetwork/QNetworkRequest> #if QT_CONFIG(topleveldomain) #include "private/qtldurl_p.h" +#include "private/qurltlds_p.h" #endif class tst_QNetworkCookieJar: public QObject @@ -477,6 +478,23 @@ void tst_QNetworkCookieJar::effectiveTLDs_data() QTest::newRow("yes-wildcard4") << "anything.sendai.jp" << true; QTest::newRow("yes-wildcard5") << "foo.sch.uk" << true; QTest::newRow("yes-wildcard6") << "something.platform.sh" << true; + + int i; + for (i = 0; tldIndices[i] < tldChunks[0]; i++) { } + Q_ASSERT(i < tldCount); + int TLDsInFirstChunk = i; + + const char *lastGroupFromFirstChunk = &tldData[0][tldIndices[TLDsInFirstChunk - 1]]; + QTest::addRow("lastGroupFromFirstChunk: %s", lastGroupFromFirstChunk) + << lastGroupFromFirstChunk + << true; + + Q_ASSERT(tldChunkCount > 1); // There are enough TLDs to fill 64K bytes + const char *lastGroupFromLastChunk = + &tldData[tldChunkCount-1][tldIndices[tldCount - 1] - tldChunks[tldChunkCount - 2]]; + QTest::addRow("lastGroupFromLastChunk: %s", lastGroupFromLastChunk) + << lastGroupFromLastChunk + << true; } void tst_QNetworkCookieJar::effectiveTLDs() |