From d897ce42be8375ffab89615ab3953b8bd3ab3bbc Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 12:22:25 +0100 Subject: All the other (blank) tests.. --- src/tests/findbar_test.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/tests/findbar_test.cpp (limited to 'src/tests/findbar_test.cpp') diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp new file mode 100644 index 00000000..0e332b6a --- /dev/null +++ b/src/tests/findbar_test.cpp @@ -0,0 +1,64 @@ +/* + * Copyright 2010 Andrea Diamantini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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 + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + + + +#include + +#include +#include +#include + +#include "findbar.h" + + + +class FindBarTest : public QObject +{ + Q_OBJECT + +public slots: + void initTestCase(); + void cleanupTestCase(); + +private slots: + + +private: + FindBar *bar; +}; + + +// ------------------------------------------- + + +void FindBarTest::initTestCase() +{ +} + + +void FindBarTest::cleanupTestCase() +{ +} + + +// ------------------------------------------- + +QTEST_MAIN(FindBarTest) +#include "findbar_test.moc" -- cgit v1.2.1 From 24a64d92d7444829edb77ba50ac618b6b0067b9d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 12:36:32 +0100 Subject: Changing Findbar parent --- src/tests/findbar_test.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/tests/findbar_test.cpp') diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp index 0e332b6a..3fb0e244 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -26,7 +26,7 @@ #include #include "findbar.h" - +#include "mainwindow.h" class FindBarTest : public QObject @@ -38,7 +38,8 @@ public slots: void cleanupTestCase(); private slots: - + void matchCase(); + void notifyMatch(); private: FindBar *bar; @@ -50,13 +51,23 @@ private: void FindBarTest::initTestCase() { + MainWindow *w = new MainWindow; + bar = new FindBar(w); } void FindBarTest::cleanupTestCase() { + delete bar; } +void FindBarTest::matchCase() +{ +} + +void FindBarTest::notifyMatch() +{ +} // ------------------------------------------- -- cgit v1.2.1 From e5e4ffa0e844c4f1cbe40eeaa309c4711c1073e6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 17:05:37 +0100 Subject: 10 (of 12) tests working and ready to be "expanded".. --- src/tests/findbar_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/tests/findbar_test.cpp') diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp index 3fb0e244..6b81255f 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -21,9 +21,8 @@ #include -#include -#include -#include +#include +#include #include "findbar.h" #include "mainwindow.h" @@ -43,6 +42,7 @@ private slots: private: FindBar *bar; + MainWindow *w; }; @@ -51,7 +51,7 @@ private: void FindBarTest::initTestCase() { - MainWindow *w = new MainWindow; + w = new MainWindow; bar = new FindBar(w); } @@ -71,5 +71,5 @@ void FindBarTest::notifyMatch() // ------------------------------------------- -QTEST_MAIN(FindBarTest) +QTEST_KDEMAIN(FindBarTest, GUI) #include "findbar_test.moc" -- cgit v1.2.1 From edea0f2fc34738de52a58f00c676e814f7a8c2fd Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 28 Feb 2010 23:58:31 +0100 Subject: First works on new Unit Tests.. --- src/tests/findbar_test.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tests/findbar_test.cpp') diff --git a/src/tests/findbar_test.cpp b/src/tests/findbar_test.cpp index 6b81255f..a79f44a2 100644 --- a/src/tests/findbar_test.cpp +++ b/src/tests/findbar_test.cpp @@ -63,6 +63,7 @@ void FindBarTest::cleanupTestCase() void FindBarTest::matchCase() { + } void FindBarTest::notifyMatch() -- cgit v1.2.1