summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLukas Vogel <lukedirtwalker@gmail.com>2018-03-16 09:27:27 +0100
committerLukas Vogel <lukedirtwalker@gmail.com>2018-03-16 10:44:39 +0100
commit827a7104cebace94802dc479e2f3ae7564a99469 (patch)
tree2d50d03f111bcd44384e14adfa62f10b4a77624d /tests
parent81f93a25e7db9b511ecf0d0ff45f3fb6435ae96e (diff)
More refactorings, contributes to #107
* Split datahelpers.h to userinfo.h and passwordconfiguration.h * Rename passwordConfiguration to PasswordConfiguration * Move some code to separate methods in MainWindow * Handle PasswordConfiguration in QtPassSettings and in ConfigDialog
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/ui/tst_ui.cpp15
-rw-r--r--tests/auto/ui/ui.pro3
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/ui/tst_ui.cpp b/tests/auto/ui/tst_ui.cpp
index 39a6bb69..1bbd4f33 100644
--- a/tests/auto/ui/tst_ui.cpp
+++ b/tests/auto/ui/tst_ui.cpp
@@ -1,4 +1,5 @@
#include "../../../src/passworddialog.h"
+#include "passwordconfiguration.h"
#include <QCoreApplication>
#include <QtTest>
@@ -17,40 +18,40 @@ private Q_SLOTS:
* is repeated when calling PasswordDialog::getPassword.
*/
void tst_ui::contentRemainsSame() {
- QScopedPointer<PasswordDialog> d(new PasswordDialog(passwordConfiguration{}, NULL));
+ QScopedPointer<PasswordDialog> d(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("", false);
QString input = "pw\n";
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
input = "pw\nname: value\n";
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("name", false);
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("name", true);
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("", false);
d->templateAll(true);
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("", true);
d->templateAll(true);
d->setPass(input);
QCOMPARE(d->getPassword(), input);
- d.reset(new PasswordDialog(passwordConfiguration{}, NULL));
+ d.reset(new PasswordDialog(PasswordConfiguration{}, NULL));
d->setTemplate("name", true);
d->templateAll(true);
d->setPass(input);
diff --git a/tests/auto/ui/ui.pro b/tests/auto/ui/ui.pro
index ca89f2b0..0f176a88 100644
--- a/tests/auto/ui/ui.pro
+++ b/tests/auto/ui/ui.pro
@@ -6,7 +6,8 @@ SOURCES += tst_ui.cpp
LIBS = -L"$$OUT_PWD/../../../src/$(OBJECTS_DIR)" -lqtpass $$LIBS
-HEADERS += passworddialog.h
+HEADERS += passworddialog.h \
+ passwordconfiguration.h
OBJ_PATH += ../../../src/$(OBJECTS_DIR)