summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-30 11:23:37 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-30 11:23:37 +0200
commitc896cc340d7e6e0878b3249c5792e6d88a12cf42 (patch)
treefd0a7a61ff1d07f301f2188de5cb6fa473134897 /src/tests
parentA tiny improvement in the error page, showing a fat icon.. :) (diff)
downloadrekonq-c896cc340d7e6e0878b3249c5792e6d88a12cf42.tar.xz
A coding style round
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/findbar_test.cpp8
-rw-r--r--src/tests/mainview_test.cpp42
-rw-r--r--src/tests/mainwindow_test.cpp6
-rw-r--r--src/tests/networkaccessmanager_test.cpp10
-rw-r--r--src/tests/protocolhandler_test.cpp42
-rw-r--r--src/tests/sessionmanager_test.cpp10
-rw-r--r--src/tests/tabbar_test.cpp38
-rw-r--r--src/tests/urlbar_test.cpp10
-rw-r--r--src/tests/walletbar_test.cpp10
-rw-r--r--src/tests/webpage_test.cpp14
-rw-r--r--src/tests/websnap_test.cpp10
-rw-r--r--src/tests/webtab_test.cpp8
-rw-r--r--src/tests/webview_test.cpp10
13 files changed, 114 insertions, 104 deletions
diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp
index a79f44a2..c9555441 100644
--- a/src/tests/findbar_test.cpp
+++ b/src/tests/findbar_test.cpp
@@ -31,11 +31,11 @@
class FindBarTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
void matchCase();
void notifyMatch();
@@ -60,10 +60,10 @@ void FindBarTest::cleanupTestCase()
{
delete bar;
}
-
+
void FindBarTest::matchCase()
{
-
+
}
void FindBarTest::notifyMatch()
diff --git a/src/tests/mainview_test.cpp b/src/tests/mainview_test.cpp
index 596ac4e1..d32eb58f 100644
--- a/src/tests/mainview_test.cpp
+++ b/src/tests/mainview_test.cpp
@@ -11,9 +11,9 @@
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
-* by the membership of KDE e.V.), which shall act as a proxy
+* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
-*
+*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -47,31 +47,31 @@ public slots:
private slots:
void tabwidget_data();
void tabwidget();
-
+
void closeTab_data();
void closeTab();
-
+
void currentWebView_data();
void currentWebView();
-
+
void newTab_data();
void newTab();
-
+
void nextTab_data();
void nextTab();
-
+
void previousTab_data();
void previousTab();
-
+
void recentlyClosedTabs_data();
void recentlyClosedTabs();
-
+
void setCurrentTitle_data();
void setCurrentTitle(const QString &);
-
+
void showStatusBarMessage_data();
void showStatusBarMessage(const QString &);
-
+
void currentChanged_data();
void currentChanged();
@@ -108,13 +108,13 @@ void MainViewTest::tabwidget_data()
void MainViewTest::tabwidget()
{
QCOMPARE(view->currentIndex(), -1);
-
-// view->newTab();
-// QCOMPARE(view->currentIndex(), 1);
+
+// view->newTab();
+// QCOMPARE(view->currentIndex(), 1);
// view->newTab();
// view->nextTab();
// QCOMPARE(view->currentIndex(), 0);
-//
+//
// view->previousTab();
// QCOMPARE(view->currentIndex(), 0);
}
@@ -131,18 +131,18 @@ void MainViewTest::closeTab_data()
void MainViewTest::closeTab()
{
// QFETCH(int, index);
-//
+//
// QSignalSpy spy1(view, SIGNAL(linkHovered(const QString &)));
// QSignalSpy spy2(view, SIGNAL(setCurrentTitle(const QString &)));
// QSignalSpy spy3(view, SIGNAL(tabsChanged()));
// QSignalSpy spy4(view, SIGNAL(lastTabClosed()));
-//
+//
// view->newTab();
// view->closeTab(index);
// view->newTab();
// view->closeTab(index);
// view->newTab();
-//
+//
// QCOMPARE(spy1.count(), 0);
// QCOMPARE(spy2.count(), 2);
// QCOMPARE(spy3.count(), 0);
@@ -197,15 +197,15 @@ void MainViewTest::newTab_data()
void MainViewTest::newTab()
{
// QFETCH(int, foo);
-//
+//
// QSignalSpy spy0(view, SIGNAL(linkHovered(const QString &)));
// QSignalSpy spy1(view, SIGNAL(setCurrentTitle(const QString &)));
// QSignalSpy spy2(view, SIGNAL(showStatusBarMessage(const QString &)));
// QSignalSpy spy3(view, SIGNAL(tabsChanged()));
// QSignalSpy spy4(view, SIGNAL(lastTabClosed()));
-//
+//
// view->newTab();
-//
+//
// QCOMPARE(spy0.count(), 0);
// QCOMPARE(spy1.count(), 0);
// QCOMPARE(spy2.count(), 0);
diff --git a/src/tests/mainwindow_test.cpp b/src/tests/mainwindow_test.cpp
index d3ab6bef..af3a2aa2 100644
--- a/src/tests/mainwindow_test.cpp
+++ b/src/tests/mainwindow_test.cpp
@@ -32,11 +32,11 @@
class MainWindowTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
@@ -61,5 +61,5 @@ void MainWindowTest::cleanupTestCase()
// -------------------------------------------
-QTEST_KDEMAIN(MainWindowTest,GUI)
+QTEST_KDEMAIN(MainWindowTest, GUI)
#include "mainwindow_test.moc"
diff --git a/src/tests/networkaccessmanager_test.cpp b/src/tests/networkaccessmanager_test.cpp
index ac6cf89e..28b05075 100644
--- a/src/tests/networkaccessmanager_test.cpp
+++ b/src/tests/networkaccessmanager_test.cpp
@@ -31,11 +31,11 @@
class NetworkAccessManagerTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -55,13 +55,13 @@ void NetworkAccessManagerTest::cleanupTestCase()
{
delete manager;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(NetworkAccessManagerTest,GUI)
+QTEST_KDEMAIN(NetworkAccessManagerTest, GUI)
#include "networkaccessmanager_test.moc"
diff --git a/src/tests/protocolhandler_test.cpp b/src/tests/protocolhandler_test.cpp
index a3c78c2f..dbf33684 100644
--- a/src/tests/protocolhandler_test.cpp
+++ b/src/tests/protocolhandler_test.cpp
@@ -33,18 +33,18 @@
class ProtocolhandlerTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
void preHandling_data();
void preHandling();
void postHandling_data();
void postHandling();
-
+
private:
ProtocolHandler *handler;
};
@@ -62,8 +62,8 @@ void ProtocolhandlerTest::cleanupTestCase()
{
delete handler;
}
-
-
+
+
// -------------------------------------------
@@ -71,7 +71,7 @@ void ProtocolhandlerTest::preHandling_data()
{
QTest::addColumn<QString>("urlString");
QTest::addColumn<bool>("result");
-
+
QTest::newRow("mailto") << "mailto:me@here.com" << true ;
QTest::newRow("relative") << "google.it" << false ;
QTest::newRow("javascript") << "javascript:alertbox('hello')" << true ;
@@ -84,15 +84,15 @@ void ProtocolhandlerTest::preHandling_data()
void ProtocolhandlerTest::preHandling()
{
- QFETCH( QString, urlString );
- QFETCH( bool , result );
-
+ QFETCH(QString, urlString);
+ QFETCH(bool , result);
+
QWebView *view = new QWebView;
QWebFrame *frame = view->page()->mainFrame();
-
- QNetworkRequest request = QNetworkRequest( QUrl(urlString) );
- QCOMPARE( handler->preHandling( request, frame ) , result );
+ QNetworkRequest request = QNetworkRequest(QUrl(urlString));
+
+ QCOMPARE(handler->preHandling(request, frame) , result);
}
@@ -100,7 +100,7 @@ void ProtocolhandlerTest::postHandling_data()
{
QTest::addColumn<QString>("urlString");
QTest::addColumn<bool>("result");
-
+
QTest::newRow("mailto") << "mailto:me@here.com" << true ;
QTest::newRow("relative") << "google.it" << false ;
QTest::newRow("javascript") << "javascript:alertbox('hello')" << false ;
@@ -113,18 +113,18 @@ void ProtocolhandlerTest::postHandling_data()
void ProtocolhandlerTest::postHandling()
{
- QFETCH( QString, urlString );
- QFETCH( bool , result );
-
+ QFETCH(QString, urlString);
+ QFETCH(bool , result);
+
QWebView *view = new QWebView;
QWebFrame *frame = view->page()->mainFrame();
-
- QNetworkRequest request = QNetworkRequest( QUrl(urlString) );
- QCOMPARE( handler->postHandling( request, frame ) , result );
+ QNetworkRequest request = QNetworkRequest(QUrl(urlString));
+
+ QCOMPARE(handler->postHandling(request, frame) , result);
}
-
+
// -------------------------------------------
-QTEST_KDEMAIN(ProtocolhandlerTest,GUI)
+QTEST_KDEMAIN(ProtocolhandlerTest, GUI)
#include "protocolhandler_test.moc"
diff --git a/src/tests/sessionmanager_test.cpp b/src/tests/sessionmanager_test.cpp
index e3e1b329..bb784219 100644
--- a/src/tests/sessionmanager_test.cpp
+++ b/src/tests/sessionmanager_test.cpp
@@ -32,11 +32,11 @@
class SessionManagerTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -57,13 +57,13 @@ void SessionManagerTest::cleanupTestCase()
{
delete sessman;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(SessionManagerTest,GUI)
+QTEST_KDEMAIN(SessionManagerTest, GUI)
#include "sessionmanager_test.moc"
diff --git a/src/tests/tabbar_test.cpp b/src/tests/tabbar_test.cpp
index 560f2c9b..6df38657 100644
--- a/src/tests/tabbar_test.cpp
+++ b/src/tests/tabbar_test.cpp
@@ -35,23 +35,33 @@
class SubTabBar : public TabBar
{
public:
-
+
SubTabBar(QWidget *parent) : TabBar(parent) {};
QSize call_tabSizeHint(int index) const
- { return SubTabBar::tabSizeHint(index); }
-
+ {
+ return SubTabBar::tabSizeHint(index);
+ }
+
void call_mouseMoveEvent(QMouseEvent* event)
- { return SubTabBar::mouseMoveEvent(event); }
-
+ {
+ return SubTabBar::mouseMoveEvent(event);
+ }
+
void call_leaveEvent(QEvent* event)
- { return SubTabBar::leaveEvent(event); }
-
+ {
+ return SubTabBar::leaveEvent(event);
+ }
+
void call_mousePressEvent(QMouseEvent* event)
- { return SubTabBar::mousePressEvent(event); }
-
+ {
+ return SubTabBar::mousePressEvent(event);
+ }
+
void call_mouseReleaseEvent(QMouseEvent* event)
- { return SubTabBar::mouseReleaseEvent(event); }
+ {
+ return SubTabBar::mouseReleaseEvent(event);
+ }
};
@@ -65,14 +75,14 @@ class TabBarTest : public QObject
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
void tabSizeHint_data();
void tabSizeHint();
-
+
void mousePress_data();
void mousePress();
-
+
private:
SubTabBar *_bar;
};
@@ -128,7 +138,7 @@ void TabBarTest::mousePress()
{
// QTest::mousePress(_bar, Qt::MidButton);
// // QCOMPARE(); ?
-//
+//
// QTest::mousePress(_bar, Qt::LeftButton);
// // QCOMPARE(); ?
}
diff --git a/src/tests/urlbar_test.cpp b/src/tests/urlbar_test.cpp
index 7a1fb40b..fc7c1718 100644
--- a/src/tests/urlbar_test.cpp
+++ b/src/tests/urlbar_test.cpp
@@ -35,11 +35,11 @@
class UrlBarTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -62,13 +62,13 @@ void UrlBarTest::cleanupTestCase()
delete bar;
delete tab;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(UrlBarTest,GUI)
+QTEST_KDEMAIN(UrlBarTest, GUI)
#include "urlbar_test.moc"
diff --git a/src/tests/walletbar_test.cpp b/src/tests/walletbar_test.cpp
index ec9c3559..d4036981 100644
--- a/src/tests/walletbar_test.cpp
+++ b/src/tests/walletbar_test.cpp
@@ -31,11 +31,11 @@
class WalletBarTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -57,13 +57,13 @@ void WalletBarTest::cleanupTestCase()
{
delete bar;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(WalletBarTest,GUI)
+QTEST_KDEMAIN(WalletBarTest, GUI)
#include "walletbar_test.moc"
diff --git a/src/tests/webpage_test.cpp b/src/tests/webpage_test.cpp
index 3051b8bf..c06ce7a5 100644
--- a/src/tests/webpage_test.cpp
+++ b/src/tests/webpage_test.cpp
@@ -34,11 +34,11 @@
class WebPageTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
void manageNetworkErrors();
void downloadRequest();
@@ -46,9 +46,9 @@ private slots:
void createWindow();
void acceptNavigationRequest();
-
+
void handleUnsupportedContent();
-
+
void loadFinished();
private:
@@ -73,8 +73,8 @@ void WebPageTest::cleanupTestCase()
{
delete tab;
}
-
-
+
+
// -------------------------------------------
@@ -108,5 +108,5 @@ void WebPageTest::loadFinished()
// -------------------------------------------
-QTEST_KDEMAIN(WebPageTest,GUI)
+QTEST_KDEMAIN(WebPageTest, GUI)
#include "webpage_test.moc"
diff --git a/src/tests/websnap_test.cpp b/src/tests/websnap_test.cpp
index 53fc1d4f..1bfb440d 100644
--- a/src/tests/websnap_test.cpp
+++ b/src/tests/websnap_test.cpp
@@ -33,11 +33,11 @@ class WebSnapTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -57,13 +57,13 @@ void WebSnapTest::cleanupTestCase()
{
delete snap;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(WebSnapTest,GUI)
+QTEST_KDEMAIN(WebSnapTest, GUI)
#include "websnap_test.moc"
diff --git a/src/tests/webtab_test.cpp b/src/tests/webtab_test.cpp
index 2c6edf35..0e5833b4 100644
--- a/src/tests/webtab_test.cpp
+++ b/src/tests/webtab_test.cpp
@@ -34,7 +34,7 @@
class WebTabTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
@@ -57,12 +57,12 @@ void WebTabTest::cleanupTestCase()
{
delete tab;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(WebTabTest,GUI)
+QTEST_KDEMAIN(WebTabTest, GUI)
#include "webtab_test.moc"
diff --git a/src/tests/webview_test.cpp b/src/tests/webview_test.cpp
index 11d1a46c..7eb968c7 100644
--- a/src/tests/webview_test.cpp
+++ b/src/tests/webview_test.cpp
@@ -33,11 +33,11 @@
class WebViewTest : public QObject
{
Q_OBJECT
-
+
public slots:
void initTestCase();
void cleanupTestCase();
-
+
private slots:
private:
@@ -60,12 +60,12 @@ void WebViewTest::cleanupTestCase()
{
delete tab;
}
-
-
+
+
// -------------------------------------------
// -------------------------------------------
-QTEST_KDEMAIN(WebViewTest,GUI)
+QTEST_KDEMAIN(WebViewTest, GUI)
#include "webview_test.moc"