diff options
| author | Frank Reininghaus <[email protected]> | 2011-04-03 15:31:27 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2011-04-03 15:32:12 +0200 |
| commit | 95cb8ffe01e0252d3a26f244e8607254200d067f (patch) | |
| tree | d76499d9b454b8730e48a2f24a55c914f7f0230c /src/tests/dolphinviewtest_allviewmodes.h | |
| parent | 5ff682d852a07b5121e49d8ed2a239b0a1762b6b (diff) | |
Dolphin unit test refactoring
This commit changes mainly two things:
1. The functionality related to the handling of temporary files and
folders is moved to a new class TestDir.
2. The setup of a temporary folder and of DolphinView instances is
now done in each unit test function. A benefit of this change is that
there are no unwanted interactions between different unit test functions
any more. Moreover, different test functions could now share a test
folder more easily.
Additionally, the reference arguments of all functions are changed to
pointers for consistency.
Diffstat (limited to 'src/tests/dolphinviewtest_allviewmodes.h')
| -rw-r--r-- | src/tests/dolphinviewtest_allviewmodes.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tests/dolphinviewtest_allviewmodes.h b/src/tests/dolphinviewtest_allviewmodes.h index c8ea61002..940ebbc1d 100644 --- a/src/tests/dolphinviewtest_allviewmodes.h +++ b/src/tests/dolphinviewtest_allviewmodes.h @@ -45,9 +45,6 @@ public: private slots: - void init(); - void cleanup(); - void testSelection(); void testViewPropertySettings(); void testZoomLevel(); @@ -55,19 +52,28 @@ private slots: void testKeyboardFocus(); -public: +private: + + /** + * Sets the correct view mode, shows the view on the screen, and waits until loading the + * folder in the view is finished. + * + * Many unit tests need access to DolphinVie's internal item view (icons, details, or columns). + * Therefore, a pointer to the item view is returned by initView(DolphinView*). + */ + QAbstractItemView* initView(DolphinView* view) const; /** Returns the view mode (Icons, Details, Columns) to be used in the test. */ virtual DolphinView::Mode mode() const = 0; /** Should return true if the view mode is correct. */ - virtual bool verifyCorrectViewMode() const = 0; + virtual bool verifyCorrectViewMode(const DolphinView* view) const = 0; /** * Waits for the DolphinView's selectionChanged(const KFileItemList&) to be emitted * and verifies that the number of selected items is as expected. */ - void verifySelectedItemsCount(int) const; + void verifySelectedItemsCount(DolphinView* view, int itemsCount) const; }; |
