mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-02 14:46:07 -04:00
Run code formatter
This commit is contained in:
parent
09181fab13
commit
1e915eef89
3 changed files with 25 additions and 27 deletions
|
@ -17,9 +17,9 @@
|
|||
|
||||
#include "TestBrowser.h"
|
||||
#include "TestGlobal.h"
|
||||
#include "browser/BrowserSettings.h"
|
||||
#include "crypto/Crypto.h"
|
||||
#include "sodium/crypto_box.h"
|
||||
#include "browser/BrowserSettings.h"
|
||||
#include <QString>
|
||||
|
||||
QTEST_GUILESS_MAIN(TestBrowser)
|
||||
|
@ -40,7 +40,6 @@ void TestBrowser::initTestCase()
|
|||
|
||||
void TestBrowser::cleanupTestCase()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,7 +86,7 @@ void TestBrowser::testDecryptMessage()
|
|||
void TestBrowser::testGetBase64FromKey()
|
||||
{
|
||||
unsigned char pk[crypto_box_PUBLICKEYBYTES];
|
||||
|
||||
|
||||
for (unsigned int i = 0; i < crypto_box_PUBLICKEYBYTES; ++i) {
|
||||
pk[i] = i;
|
||||
}
|
||||
|
@ -202,7 +201,7 @@ void TestBrowser::testSearchEntries()
|
|||
}
|
||||
|
||||
browserSettings()->setMatchUrlScheme(false);
|
||||
auto result = m_browserService->searchEntries(db, "github.com", "https://github.com"); // db, hostname, url
|
||||
auto result = m_browserService->searchEntries(db, "github.com", "https://github.com"); // db, hostname, url
|
||||
QCOMPARE(result.length(), 7);
|
||||
QCOMPARE(result[0]->url(), QString("https://github.com/login_page"));
|
||||
QCOMPARE(result[1]->url(), QString("https://github.com/login"));
|
||||
|
@ -210,11 +209,11 @@ void TestBrowser::testSearchEntries()
|
|||
QCOMPARE(result[3]->url(), QString("http://github.com"));
|
||||
QCOMPARE(result[4]->url(), QString("http://github.com/login"));
|
||||
QCOMPARE(result[5]->url(), QString("github.com"));
|
||||
QCOMPARE(result[6]->url(), QString("github.com")) ;
|
||||
QCOMPARE(result[6]->url(), QString("github.com"));
|
||||
|
||||
// With matching there should be only 5 results
|
||||
browserSettings()->setMatchUrlScheme(true);
|
||||
result = m_browserService->searchEntries(db, "github.com", "https://github.com"); // db, hostname, url
|
||||
result = m_browserService->searchEntries(db, "github.com", "https://github.com"); // db, hostname, url
|
||||
QCOMPARE(result.length(), 5);
|
||||
QCOMPARE(result[0]->url(), QString("https://github.com/login_page"));
|
||||
QCOMPARE(result[1]->url(), QString("https://github.com/login"));
|
||||
|
@ -241,7 +240,7 @@ void TestBrowser::testSearchEntriesWithPort()
|
|||
entry->endUpdate();
|
||||
}
|
||||
|
||||
auto result = m_browserService->searchEntries(db, "127.0.0.1", "http://127.0.0.1:443"); // db, hostname, url
|
||||
auto result = m_browserService->searchEntries(db, "127.0.0.1", "http://127.0.0.1:443"); // db, hostname, url
|
||||
QCOMPARE(result.length(), 1);
|
||||
QCOMPARE(result[0]->url(), QString("http://127.0.0.1:443"));
|
||||
}
|
||||
|
@ -275,7 +274,8 @@ void TestBrowser::testSortEntries()
|
|||
}
|
||||
|
||||
browserSettings()->setBestMatchOnly(false);
|
||||
auto result = m_browserService->sortEntries(entries, "github.com", "https://github.com/session"); // entries, host, submitUrl
|
||||
auto result =
|
||||
m_browserService->sortEntries(entries, "github.com", "https://github.com/session"); // entries, host, submitUrl
|
||||
QCOMPARE(result.size(), 10);
|
||||
QCOMPARE(result[0]->username(), QString("User 2"));
|
||||
QCOMPARE(result[0]->url(), QString("https://github.com/"));
|
||||
|
@ -318,7 +318,7 @@ void TestBrowser::testGetDatabaseGroups()
|
|||
|
||||
auto result = m_browserService->getDatabaseGroups(db);
|
||||
QCOMPARE(result.length(), 1);
|
||||
|
||||
|
||||
auto groups = result["groups"].toArray();
|
||||
auto first = groups.at(0);
|
||||
auto children = first.toObject()["children"].toArray();
|
||||
|
@ -341,4 +341,4 @@ void TestBrowser::testGetDatabaseGroups()
|
|||
auto lastChildren = firstOfCOS.toObject()["children"].toArray();
|
||||
auto lastChild = lastChildren.at(0);
|
||||
QCOMPARE(lastChild.toObject()["name"].toString(), QString("group2_1_1"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue