Skip to content

Fix ParseDomain test failing on specific Qt version - #1257

Open
deXol wants to merge 1 commit into
mooltipass:masterfrom
deXol:fixParseDomainTest
Open

Fix ParseDomain test failing on specific Qt version#1257
deXol wants to merge 1 commit into
mooltipass:masterfrom
deXol:fixParseDomainTest

Conversation

@deXol

@deXol deXol commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

tests/TestParseDomain.cpp was failing in CI/packaging builds on Qt 5.15.18 (GCC 15.2.0, Ubuntu 26.04), while passing locally on Qt 5.15.13:

FAIL! : TestParseDomain::test_URLs(only TLD blogspot) Compared values are not the same
   Actual   (url.isWebsite()): 1
   Expected (isWebsite)      : 0

FAIL! : TestParseDomain::test_URLs(long TLD: blogspot) Compared values are not the same
   Actual   (url.tld()): ".be"
   Expected (tld)      : ".blogspot.be"

Root cause

ParseDomain looks up TLDs in a hash table vendored in src/utils/qurltlds_p.h, using:

int index = qt_hash(entry, qt_hash(symbol)) % tldCount;

qt_hash() isn't vendored, it's compiled into libQt5Core.so, and it's a private, unstable Qt internal whose behavior can differ between point releases.

The table was generated against one specific Qt version's qt_hash(). When linked against a different version (5.15.18 vs 5.15.13), some entries hash into the wrong bucket and silently fail to resolve — in this case blogspot.be — while most others still work.

Fix

blogspot.be is a Blogger-specific "private domain" PSL entry that Google has been deprecating in favor of blogspot.com, making it more likely to be pruned for error.

Replaced both affected rows in tests/TestParseDomain.cpp with co.uk - while exercising the same code path (multi-label TLD parsing, tld_dots > 0 in ParseDomain.cpp):

  • "only TLD blogspot""only TLD co.uk" (http://blogspot.be/...http://co.uk/...)
  • "long TLD: blogspot""long TLD: co.uk" (daniel.brown.blogspot.bedaniel.brown.co.uk)

@deXol
deXol requested a review from limpkin September 8, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant