From f507a7a5557c7cca9570c684920e055c5251b08e Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 18 Jul 2018 10:07:51 +0200 Subject: AdBlockRule: move matching logic to FilterRule --- test/urlfilter/adblocktest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/urlfilter/adblocktest.cpp') diff --git a/test/urlfilter/adblocktest.cpp b/test/urlfilter/adblocktest.cpp index 304a29e..416bc20 100644 --- a/test/urlfilter/adblocktest.cpp +++ b/test/urlfilter/adblocktest.cpp @@ -2,10 +2,10 @@ #include #include "urlfilter/adblockrule.h" -inline bool check(const std::vector rules, const QUrl &url) +inline bool check(const std::vector rules, const QUrl &url) { - for(const AdBlockRule &rule : rules) { - if(rule.matchesUrl(url)) + for(const FilterRule &rule : rules) { + if(rule.matchesDomain(url.host()) && rule.matchesUrl(url)) return true; } return false; @@ -13,7 +13,7 @@ inline bool check(const std::vector rules, const QUrl &url) void AdBlockTest::parseList() { - std::vector rules; + std::vector rules; QFile list("adblock.txt"); QCOMPARE(list.open(QIODevice::ReadOnly | QIODevice::Text), true); -- cgit v1.2.1