aboutsummaryrefslogtreecommitdiff
path: root/test/hostlist
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-10-19 01:44:06 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-10-19 01:44:06 +0200
commit77b3cd57f930ec70e6f618da70985e23e5cf76fc (patch)
tree712dbb43ec463a8524286d9e6e0fb2d2f8b9d6ab /test/hostlist
parenturlfilter: destroy FilterLeaves only when destroying the FilterTree (diff)
downloadsmolbote-77b3cd57f930ec70e6f618da70985e23e5cf76fc.tar.xz
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
Diffstat (limited to 'test/hostlist')
-rw-r--r--test/hostlist/hostlisttest.cpp10
1 files changed, 5 insertions, 5 deletions
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<const FilterLeaf *> block = tree.match(QString(), "blockeddomain.com");
+ QVector<const FilterLeaf *> block = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.com"));
QCOMPARE(block.length(), 1);
QCOMPARE(block.constFirst()->action(), FilterLeaf::Block);
// test redirect
- QVector<const FilterLeaf *> redirectResult = tree.match(QString(), "localhost.localdomain");
+ QVector<const FilterLeaf *> 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<const FilterLeaf *> blockFirst = tree.match(QString(), "blockeddomain.first");
+ QVector<const FilterLeaf *> blockFirst = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.first"));
QCOMPARE(blockFirst.length(), 1);
QCOMPARE(blockFirst.constFirst()->action(), FilterLeaf::Block);
- QVector<const FilterLeaf *> blockSecond = tree.match(QString(), "blockeddomain.second");
+ QVector<const FilterLeaf *> blockSecond = tree.match(QUrl(), QUrl::fromUserInput("blockeddomain.second"));
QCOMPARE(blockSecond.length(), 1);
QCOMPARE(blockSecond.constFirst()->action(), FilterLeaf::Block);
// domain not on list
- QVector<const FilterLeaf *> missing = tree.match(QString(), "other.domain");
+ QVector<const FilterLeaf *> missing = tree.match(QUrl(), QUrl::fromUserInput("other.domain"));
QCOMPARE(missing.length(), 0);
}