From b37cf68810f01364297d2bc15643a32f23fca5f5 Mon Sep 17 00:00:00 2001 From: Dimitrios Apostolou Date: Wed, 20 May 2020 12:26:16 +0200 Subject: Add tests for a couple of edge cases Change-Id: I1cd799cc671fa2191e20d4681632588dc79e98dd Reviewed-by: Edward Welbourne --- .../access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/auto/network/access/qnetworkcookiejar') 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 #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() -- cgit v1.2.3