Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Catch2 integration #9199

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
77ef16e
PassphraseGenerator: initial Catch2 integration
dmaslenko Mar 4, 2023
3abee8c
PassphraseGenerator: add missed unit tests for estimateEntropy()
dmaslenko Mar 20, 2023
2bc83da
PassphraseGenerator: add missed PGP unit test
dmaslenko Apr 25, 2023
44e7189
PassphraseGenerator: remove dead m_wordCount checking for zero
dmaslenko Apr 25, 2023
e2db388
Add destroy() for KeeShare and call it from MainWindow destructor
dmaslenko Mar 14, 2023
0672e23
PassphraseGenerator: migrate GUI tests on Catch2
dmaslenko Mar 8, 2023
6d97c31
PassphraseGenerator: add a GUI scenario with open DB
dmaslenko Mar 15, 2023
a000275
TOTP: migrate GUI tests on Catch2
dmaslenko Apr 7, 2023
e9b6166
Merge gui tests under one executable
droidmonkey Apr 16, 2023
499e5e9
TOTP: remove dead supportedEncoders()
dmaslenko Apr 22, 2023
5973c96
TOTP: migrate TestTotp on Catch2
dmaslenko Apr 20, 2023
b08da1c
PasswordGenerator: migrate GUI tests on Catch2
dmaslenko May 9, 2023
c838320
Database locking: migrate GUI test on Catch2
dmaslenko Feb 4, 2024
bf21afc
FixtureWithDb: copy checkDatabase() methods from TestGui
dmaslenko Feb 5, 2024
6358a19
Database saving: migrate GUI test saveAs on Catch2
dmaslenko Feb 5, 2024
fa5a13e
Database saving: migrate GUI test save on Catch2
dmaslenko Feb 10, 2024
1627936
Database saving: migrate GUI test saveBackup on Catch2
dmaslenko Feb 10, 2024
a9dbef3
Database saving: migrate GUI test saveBackupPath on Catch2
dmaslenko Feb 12, 2024
3d53e77
Database locking: migrate GUI test on Catch2
dmaslenko Feb 4, 2024
7e09959
Settings: migrate GUI testSettingsDefaultTabOrder to Catch2
dmaslenko Feb 18, 2024
65b7414
Database creating: migrate GUI test on Catch2
dmaslenko Feb 26, 2024
57d9863
Database merging: migrate GUI test on Catch2
dmaslenko Mar 2, 2024
f2a7dae
TestPasswordGeneratorGui: merge new changes from TestGUI
dmaslenko Apr 6, 2024
18e206d
Database autoreload: migrate GUI test on Catch2
dmaslenko Apr 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ add_subdirectory(src)
add_subdirectory(share)
if(WITH_TESTS)
add_subdirectory(tests)
add_subdirectory(tests2)
endif(WITH_TESTS)

if(WITH_XC_DOCS)
Expand Down
4 changes: 0 additions & 4 deletions src/core/PassphraseGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,5 @@ QString PassphraseGenerator::generatePassphrase() const

bool PassphraseGenerator::isValid() const
{
if (m_wordCount == 0) {
return false;
}

return m_wordlist.size() >= 1000;
}
9 changes: 0 additions & 9 deletions src/core/Totp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,6 @@ QString Totp::generateTotp(const QSharedPointer<Totp::Settings>& settings, const
return retval;
}

QList<QPair<QString, QString>> Totp::supportedEncoders()
{
QList<QPair<QString, QString>> encoders;
for (auto& encoder : totpEncoders) {
encoders << QPair<QString, QString>(encoder.name, encoder.shortName);
}
return encoders;
}

QList<QPair<QString, Totp::Algorithm>> Totp::supportedAlgorithms()
{
QList<QPair<QString, Algorithm>> algorithms;
Expand Down
4 changes: 4 additions & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ MainWindow::~MainWindow()
#ifdef WITH_XC_SSHAGENT
sshAgent()->removeAllIdentities();
#endif

#if defined(WITH_XC_KEESHARE)
KeeShare::destroy();
#endif
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/gui/PasswordWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ PasswordWidget::PasswordWidget(QWidget* parent)
icons()->onOffIcon("password-show", false),
tr("Toggle Password (%1)").arg(QKeySequence(modifier + Qt::Key_H).toString(QKeySequence::NativeText)),
this);
m_toggleVisibleAction->setObjectName(QString("passwordToggleVisibleAction"));
m_toggleVisibleAction->setCheckable(true);
m_toggleVisibleAction->setShortcut(modifier + Qt::Key_H);
m_toggleVisibleAction->setShortcutContext(Qt::WidgetShortcut);
Expand Down
6 changes: 6 additions & 0 deletions src/keeshare/KeeShare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ void KeeShare::init(QObject* parent)
m_instance = new KeeShare(parent);
}

void KeeShare::destroy()
{
delete m_instance;
m_instance = nullptr;
}

KeeShareSettings::Own KeeShare::own()
{
// Read existing own certificate or generate a new one if none available
Expand Down
1 change: 1 addition & 0 deletions src/keeshare/KeeShare.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class KeeShare : public QObject
public:
static KeeShare* instance();
static void init(QObject* parent);
static void destroy();

static QString indicatorSuffix(const Group* group, const QString& text);
static QPixmap indicatorBadge(const Group* group, QPixmap pixmap);
Expand Down
6 changes: 0 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,9 @@ add_unit_test(NAME testpasswordgenerator SOURCES TestPasswordGenerator.cpp
add_unit_test(NAME testpasswordhealth SOURCES TestPasswordHealth.cpp
LIBS ${TEST_LIBRARIES})

add_unit_test(NAME testpassphrasegenerator SOURCES TestPassphraseGenerator.cpp
LIBS ${TEST_LIBRARIES})

add_unit_test(NAME testhibp SOURCES TestHibp.cpp
LIBS ${TEST_LIBRARIES})

add_unit_test(NAME testtotp SOURCES TestTotp.cpp
LIBS ${TEST_LIBRARIES})

add_unit_test(NAME testbase32 SOURCES TestBase32.cpp
LIBS ${TEST_LIBRARIES})

Expand Down
54 changes: 0 additions & 54 deletions tests/TestPassphraseGenerator.cpp

This file was deleted.

32 changes: 0 additions & 32 deletions tests/TestPassphraseGenerator.h

This file was deleted.

179 changes: 0 additions & 179 deletions tests/TestTotp.cpp

This file was deleted.

36 changes: 0 additions & 36 deletions tests/TestTotp.h

This file was deleted.

Loading
Loading