mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-07 22:12:59 -04:00
Extend TestEntrySearcher.
This commit is contained in:
parent
4f60df029d
commit
c2940a8f18
2 changed files with 16 additions and 1 deletions
|
@ -92,7 +92,6 @@ void TestEntrySearcher::testSearch()
|
||||||
e3b->setGroup(group3);
|
e3b->setGroup(group3);
|
||||||
|
|
||||||
m_searchResult = m_entrySearcher.search("search term", m_groupRoot, Qt::CaseInsensitive);
|
m_searchResult = m_entrySearcher.search("search term", m_groupRoot, Qt::CaseInsensitive);
|
||||||
|
|
||||||
QCOMPARE(m_searchResult.count(), 3);
|
QCOMPARE(m_searchResult.count(), 3);
|
||||||
|
|
||||||
m_searchResult = m_entrySearcher.search("search term", group211, Qt::CaseInsensitive);
|
m_searchResult = m_entrySearcher.search("search term", group211, Qt::CaseInsensitive);
|
||||||
|
@ -130,3 +129,17 @@ void TestEntrySearcher::testAndConcatenationInSearch()
|
||||||
m_searchResult = m_entrySearcher.search("abc kl", m_groupRoot, Qt::CaseInsensitive);
|
m_searchResult = m_entrySearcher.search("abc kl", m_groupRoot, Qt::CaseInsensitive);
|
||||||
QCOMPARE(m_searchResult.count(), 1);
|
QCOMPARE(m_searchResult.count(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestEntrySearcher::testAllAttributesAreSearched()
|
||||||
|
{
|
||||||
|
Entry* entry = new Entry();
|
||||||
|
entry->setGroup(m_groupRoot);
|
||||||
|
|
||||||
|
entry->setTitle("testTitle");
|
||||||
|
entry->setUsername("testUsername");
|
||||||
|
entry->setUrl("testUrl");
|
||||||
|
entry->setNotes("testNote");
|
||||||
|
|
||||||
|
m_searchResult = m_entrySearcher.search("testTitle testUsername testUrl testNote", m_groupRoot, Qt::CaseInsensitive);
|
||||||
|
QCOMPARE(m_searchResult.count(), 1);
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ private Q_SLOTS:
|
||||||
|
|
||||||
void testAndConcatenationInSearch();
|
void testAndConcatenationInSearch();
|
||||||
void testSearch();
|
void testSearch();
|
||||||
|
void testAllAttributesAreSearched();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Group* m_groupRoot;
|
Group* m_groupRoot;
|
||||||
EntrySearcher m_entrySearcher;
|
EntrySearcher m_entrySearcher;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue