diff options
| author | Frank Reininghaus <[email protected]> | 2010-10-29 14:13:11 +0000 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2010-10-29 14:13:11 +0000 |
| commit | b1e69cae00a708aa50dbd03eca944e83a639d861 (patch) | |
| tree | 83db23b6f8c49f6fd786b3b3c0656fde58abadaa /src/tests/dolphindetailsviewtest.cpp | |
| parent | 454a0a6539384aff0578379f8b18703a0cadd86b (diff) | |
It's easier to put functionality that is used by many unit tests into
a common base class. I took that idea from Nepomuk's unit tests in
kdelibs.
svn path=/trunk/KDE/kdebase/apps/; revision=1191051
Diffstat (limited to 'src/tests/dolphindetailsviewtest.cpp')
| -rw-r--r-- | src/tests/dolphindetailsviewtest.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/tests/dolphindetailsviewtest.cpp b/src/tests/dolphindetailsviewtest.cpp index ab3006d9d..bf77830f7 100644 --- a/src/tests/dolphindetailsviewtest.cpp +++ b/src/tests/dolphindetailsviewtest.cpp @@ -19,7 +19,7 @@ #include <qtest_kde.h> -#include "testhelper.h" +#include "testbase.h" #include "views/dolphindetailsview.h" #include "views/dolphinview.h" @@ -34,21 +34,16 @@ #include "kdebug.h" -class DolphinDetailsViewTest : public QObject +class DolphinDetailsViewTest : public TestBase { Q_OBJECT private slots: void initTestCase(); - void cleanupTestCase(); void bug234600_overlappingIconsWhenZooming(); -private: - - TestHelper* m_helper; - DolphinView* m_view; }; void DolphinDetailsViewTest::initTestCase() @@ -56,14 +51,6 @@ void DolphinDetailsViewTest::initTestCase() // add time stamps to find origin of test failures due to timeout at // http://my.cdash.org/index.php?project=kdebase&date= qputenv("KDE_DEBUG_TIMESTAMP", QByteArray("1")); - - m_helper = new TestHelper; - m_view = m_helper->view(); -} - -void DolphinDetailsViewTest::cleanupTestCase() -{ - delete m_helper; } /** @@ -79,10 +66,10 @@ void DolphinDetailsViewTest::bug234600_overlappingIconsWhenZooming() { QStringList files; files << "a" << "b" << "c" << "d"; - m_helper->createFiles(files); + createFiles(files); m_view->setMode(DolphinView::DetailsView); - DolphinDetailsView* detailsView = qobject_cast<DolphinDetailsView*>(m_helper->itemView()); + DolphinDetailsView* detailsView = qobject_cast<DolphinDetailsView*>(itemView()); QVERIFY(detailsView); m_view->resize(400, 400); m_view->show(); @@ -126,7 +113,7 @@ void DolphinDetailsViewTest::bug234600_overlappingIconsWhenZooming() m_view->hide(); kDebug() << "Cleaning up test directory..."; - m_helper->cleanupTestDir(); + cleanupTestDir(); kDebug() << "Done."; } |
