-
Notifications
You must be signed in to change notification settings - Fork 800
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
nmc/add new unit test files #5867
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
|
||
#include "ui_accountsettings.h" | ||
#include "accountsettings.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestAccountSettings: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestAccountSettings) | ||
#include "testaccountsettings.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
#include "configfile.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestConfigFile: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestConfigFile) | ||
#include "testconfigfile.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
#include "wizard/flow2authwidget.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestFlow2AuthWidget: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestFlow2AuthWidget) | ||
#include "testflow2authwidget.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
#include <QPainter> | ||
|
||
#include "folderstatusmodel.h" | ||
#define private public | ||
#include "folderstatusdelegate.h" | ||
#undef private | ||
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this "trick" will work because we are using a static library
why not "just" make your test a friend of the class you are testing ? That would also be more in line with the current state of the automated tests of the desktop client ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, friend class is very simple and easy solution, I avoided this because of only data/member privacy concern. |
||
|
||
using namespace OCC; | ||
|
||
class TestFolderStatusDelegate: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestFolderStatusDelegate) | ||
#include "testfolderstatusdelegate.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
|
||
#include "localdiscoverytracker.h" | ||
#include "folderstatusmodel.h" | ||
#include "syncrunfilelog.h" | ||
#include "syncengine.h" | ||
#include "account.h" | ||
|
||
#define private public | ||
#include "accountstate.h" | ||
#include "syncresult.h" | ||
#include "folder.h" | ||
#include "theme.h" | ||
#undef private | ||
Comment on lines
+16
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment |
||
|
||
using namespace OCC; | ||
|
||
class TestFolderStatusModel: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_GUILESS_MAIN(TestFolderStatusModel) | ||
#include "testfolderstatusmodel.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QWizardPage> | ||
#include <QtTest> | ||
|
||
#include "creds/abstractcredentials.h" | ||
#include "folderwizard.h" | ||
#include "accountstate.h" | ||
#include "testhelper.h" | ||
#include "folderman.h" | ||
#include "account.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestFolderWizard: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestFolderWizard) | ||
#include "testfolderwizard.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
|
||
#include "theme.h" | ||
#include "folderman.h" | ||
#include "configfile.h" | ||
#define private public | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment |
||
#include "generalsettings.h" | ||
#undef private | ||
#include "ui_generalsettings.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestGeneralSettings: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestGeneralSettings) | ||
#include "testgeneralsettings.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QQmlEngine> | ||
#include <QQuickItem> | ||
#include <QQuickView> | ||
#include <QtTest> | ||
|
||
#include "theme.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestHeaderButton: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestHeaderButton) | ||
#include "testheaderbutton.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
|
||
#include "wizard/owncloudadvancedsetuppage.h" | ||
#include "wizard/owncloudwizard.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestOwncloudAdvancedSetupPage: public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestOwncloudAdvancedSetupPage) | ||
#include "testowncloudadvancedsetuppage.moc" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* This software is in the public domain, furnished "as is", without technical | ||
* support, and with no warranty, express or implied, as to its usefulness for | ||
* any purpose. | ||
* | ||
*/ | ||
|
||
#include <QtTest> | ||
|
||
#include "wizard/owncloudsetuppage.h" | ||
|
||
using namespace OCC; | ||
|
||
class TestOwncloudSetupPage: public QWidget | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
|
||
}; | ||
|
||
QTEST_MAIN(TestOwncloudSetupPage) | ||
#include "testowncloudsetuppage.moc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.