From 77b3cd57f930ec70e6f618da70985e23e5cf76fc Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 19 Oct 2018 01:44:06 +0200 Subject: Integrate FilterTree into browser (#6) - change filter.path to filter.hosts to represent that the setting is only used for hostlist-format lists - change FilterTree::match to use QUrl and not QString --- test/hostlist/hostlisttest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/hostlist') diff --git a/test/hostlist/hostlisttest.cpp b/test/hostlist/hostlisttest.cpp index 46f6a85..cd1d39f 100644 --- a/test/hostlist/hostlisttest.cpp +++ b/test/hostlist/hostlisttest.cpp @@ -16,26 +16,26 @@ void HostlistTest::parseList() void HostlistTest::checkRules() { // test block - QVector block = tree.match(QString(), "blockeddomain.com"); + QVector block = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.com")); QCOMPARE(block.length(), 1); QCOMPARE(block.constFirst()->action(), FilterLeaf::Block); // test redirect - QVector redirectResult = tree.match(QString(), "localhost.localdomain"); + QVector redirectResult = tree.match(QUrl(), QUrl::fromUserInput("localhost.localdomain")); QCOMPARE(redirectResult.length(), 1); QCOMPARE(redirectResult.at(0)->action(), FilterLeaf::Redirect); QCOMPARE(redirectResult.at(0)->redirect(), "127.0.0.1"); // two domains on one line - QVector blockFirst = tree.match(QString(), "blockeddomain.first"); + QVector blockFirst = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.first")); QCOMPARE(blockFirst.length(), 1); QCOMPARE(blockFirst.constFirst()->action(), FilterLeaf::Block); - QVector blockSecond = tree.match(QString(), "blockeddomain.second"); + QVector blockSecond = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.second")); QCOMPARE(blockSecond.length(), 1); QCOMPARE(blockSecond.constFirst()->action(), FilterLeaf::Block); // domain not on list - QVector missing = tree.match(QString(), "other.domain"); + QVector missing = tree.match(QUrl(), QUrl::fromUserInput("other.domain")); QCOMPARE(missing.length(), 0); } -- cgit v1.2.1